Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mdkaifansari04
Copy link
Contributor

@mdkaifansari04 mdkaifansari04 commented Nov 8, 2025

Fixes: #4755

Description
This removes the old DEFAULT_FILE_STORAGE line from settings.py.
It is deprecated in Django 4.2+ and conflicts with the STORAGES dict already defined.

This fixes the local test failure and keeps production behavior unchanged since Heroku uses the correct storage config inside its block.

Screenshot before resolving
2025-11-08_21-56-11

Screenshot after resolving
2025-11-08_22-17-52

Summary by CodeRabbit

  • Refactor
    • Updated file storage configuration system to use dictionary-based configuration, streamlining storage backend management.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 8, 2025

Walkthrough

Removed the deprecated DEFAULT_FILE_STORAGE setting from blt/settings.py. The application now relies exclusively on the STORAGES dictionary for file storage backend configuration, aligning with Django 4.2+ standards.

Changes

Cohort / File(s) Summary
Django settings deprecation fix
blt/settings.py
Removed DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" line to eliminate Django 4.2+ deprecation error caused by mutually exclusive DEFAULT_FILE_STORAGE and STORAGES configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single-line removal of deprecated configuration
  • No logic changes or functional impact
  • Clear alignment with Django 4.2+ requirements
  • Existing STORAGES dictionary already provides equivalent configuration for both local and production environments

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: removing a deprecated Django setting from the codebase.
Linked Issues check ✅ Passed The pull request fully addresses all coding requirements from issue #4755: removes DEFAULT_FILE_STORAGE, relies on STORAGES configuration, and resolves the Django 4.2+ deprecation conflict.
Out of Scope Changes check ✅ Passed All changes are directly related to the objective of removing deprecated DEFAULT_FILE_STORAGE; no out-of-scope modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-project-automation github-project-automation bot moved this from Backlog to Ready in 📌 OWASP BLT Project Board Nov 8, 2025
@DonnieBLT DonnieBLT merged commit b4110c8 into OWASP-BLT:main Nov 8, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Fix deprecated DEFAULT_FILE_STORAGE setting in Django 4.2+

2 participants