fix: Removed DEFAULT_FILE_STORAGE and STATICFILES_STORAGES#2917
fix: Removed DEFAULT_FILE_STORAGE and STATICFILES_STORAGES#2917jawad-khan wants to merge 2 commits intoopenedx:masterfrom
Conversation
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
| 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.
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