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.
--
Ticket URL: <https://code.djangoproject.com/ticket/19724>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
I can reproduce the problem and I think it's caused by:
{{{
try:
apps = settings.INSTALLED_APPS
except ImproperlyConfigured:
# Still useful for commands that do not require functional
settings,
# like startproject or help
apps = []
}}}
in `django.core.management.get_commands`, as an invalid `MEDIA_URL` raises
`ImproperlyConfigured` when the settings are first accessed.
--
Ticket URL: <https://code.djangoproject.com/ticket/19724#comment:1>
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/19724#comment:2>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/19724#comment:3>
* stage: Accepted => Ready for checkin
Comment:
That looks great to me! Just one nitpicky comment: it'd be useful to
emphasize the causality between the two statements:
{{{
Project settings contain errors: <ERROR>
As a result, only the core Django commands are available.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/19724#comment:4>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"40ca99097f34b2180b2afe6d0056cade4c732618"]:
{{{
#!CommitTicketReference repository=""
revision="40ca99097f34b2180b2afe6d0056cade4c732618"
Fixed #19724 -- Output error when settings are improperly configured
...during retrieval of available management commands.
Thanks Peter Davis for the report and Julien Phalip for the review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/19724#comment:5>
Comment (by Claude Paroz <claude@…>):
In [changeset:"2edef932ff4ffc766c7abe18bde2cc77babd8fef"]:
{{{
#!CommitTicketReference repository=""
revision="2edef932ff4ffc766c7abe18bde2cc77babd8fef"
Revert "Fixed #19724 -- Output error when settings are improperly
configured"
This reverts commit 40ca99097f34b2180b2afe6d0056cade4c732618.
Outputting error is not always suitable, for example this shouldn't
happen for the 'startproject' command.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/19724#comment:6>
* status: closed => new
* resolution: fixed =>
Comment:
The patch was not good.
For example, when running `django-admin.py startproject`, accessing
`settings.INSTALLED_APPS` will always raise `ImproperlyConfigured` and
this is the regular behaviour (no errors should be shown).
--
Ticket URL: <https://code.djangoproject.com/ticket/19724#comment:7>
* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/19724#comment:8>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"a098bee1b9fa4df64f3fd72ff5cbae43bf27e539"]:
{{{
#!CommitTicketReference repository=""
revision="a098bee1b9fa4df64f3fd72ff5cbae43bf27e539"
Fixed #19724 -- Output note when showing only core management commands
When listing available management commands, only core commands are
listed if settings have any error. This commit adds a note in this
case so errors are not totally silently skipped.
Thanks Peter Davis for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/19724#comment:9>