manage.py app commands enumeration fails silently when MEDIA_URL doesn't end with a slash
When the MEDIA_URL setting in settings.py does not contain a forward slash at the end, calling manage.py without arguments will result in only django core commands being displayed, but no application commands (as specified in INSTALLED_APPS) are shown.
This is presumably due to the parsing of the settings.py file failing silently on the incorrect MEDIA_URL setting. Although it is explicitly called out within the settings.py file (within comments above the MEDIA_URL setting), having it fail loudly when running manage.py is potentially a more expected behaviour.
Attachments
(1)
- 19724-1.diff
(851 bytes
) - added by Claude Paroz 12 years ago.
- Ouptut error message on sys.stderr if settings contain errors
Download all attachments as:
.zip
Change History
(10)
Triage Stage: |
Unreviewed → Accepted
|
Type: |
Uncategorized → Bug
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Resolution: |
fixed
|
Status: |
closed → new
|
Patch needs improvement: |
set
|
Triage Stage: |
Ready for checkin → Accepted
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
I can reproduce the problem and I think it's caused by:
in
django.core.management.get_commands
, as an invalidMEDIA_URL
raisesImproperlyConfigured
when the settings are first accessed.