#21634: Lis of installed apps set to empty when ImproperlyConfigured exception
is
raised
--------------------------------------------+--------------------
Reporter: nikolay.v.golub@… | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Management commands) | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------------+--------------------
This code in django.core.management. !__init!__.py at line 104
{{{
#!div style="font-size: 80%"
Code highlighting:
{{{#!python
# Find the installed apps
from django.conf import settings
try:
apps = settings.INSTALLED_APPS
except ImproperlyConfigured:
# Still useful for commands that do not require functional
settings,
# like startproject or help
apps = []
}}}
}}}
Says, that apps will be set to [] if ImproperlyConfigured exception is
raised. This leads to misunderstanding, when error raised for wrong
configuration of 3rd-party application.
Also this code contradicts PEP-20:
* Explicit is better than implicit
* Errors should never pass silently
For example if you use South, and have any 3rd party app, that can raise
ImproperlyConfigured exception you will get following error when you'll
try to migrate apps db schema:
{{{
Unknown command: 'migrate'
Type 'manage.py help' for usage.
}}}
What purpose of this catching? If something is improperly configured,
maybe user should know about it?
Please, review this ticket and remove this catching.
--
Ticket URL: <https://code.djangoproject.com/ticket/21634>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.0c713ebd7c8a58b412bacf22796ccea0%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.