-
Notifications
You must be signed in to change notification settings - Fork 81
fix: Removed DEFAULT_FILE_STORAGE and STATICFILES_STORAGES #2917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix: Removed DEFAULT_FILE_STORAGE and STATICFILES_STORAGES #2917
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes deprecated Django storage configuration settings (DEFAULT_FILE_STORAGE and STATICFILES_STORAGE) from both production and devstack environments. The codebase now relies on Django's modern STORAGES dictionary configuration (defined in base.py), which is the standard approach since Django 4.2 and required in Django 5.x (the project uses Django 5.2.7).
- Removes code that attempted to override
STORAGESdictionary values using deprecated environment variables and YAML configuration keys - Updates inline documentation to reflect the removal of deprecated settings handling
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| credentials/settings/production.py | Removes YAML-based configuration for deprecated DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings and their mapping to the STORAGES dictionary |
| credentials/settings/devstack.py | Removes environment variable-based configuration for deprecated DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
credentials/settings/production.py
Outdated
|
|
||
| # Load the files storage backend settings for django storages | ||
| # In django==4.2.24 following line sets the DEFAULT_FILE_STORAGE and other AWS variables as per YAML. | ||
| # In django==4.2.24 following line sets AWS variables as per YAML. |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment references django==4.2.24, but requirements/django.txt indicates the project is using Django 5.2.7. The comment should be updated to reflect the actual Django version being used.
| # In django==4.2.24 following line sets AWS variables as per YAML. | |
| # In django==5.2.7 the following line sets AWS variables as per YAML. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the inline comment.
| vars().update(config_from_yaml) | ||
|
|
||
| FILE_STORAGE_BACKEND = config_from_yaml.get("FILE_STORAGE_BACKEND", {}) | ||
| default_backend = FILE_STORAGE_BACKEND.pop("DEFAULT_FILE_STORAGE", None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without STORAGES dict inside prod yaml we cant make these changes. It will break production
Remove DEFAULT_FILE_STORAGE and STATICFILES_STORAGES. This addresses issue.
Tested with this yml.
Run JavaScript tests locally with Karma
There is work being done on a fix to get Karma to run in CI. Until then, however, contributors are required to run these tests locally.
make test-karma