List of installed apps set to empty when ImproperlyConfigured exception is raised
|Reported by:||Owned by:||Erik Romijn|
|Component:||Core (Management commands)||Version:||1.6|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This code in django.core.management. __init__.py at line 104
# 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.
Change History (6)
comment:5 Changed 3 years ago by
|Owner:||changed from nobody to Erik Romijn|
|Status:||new → assigned|
|Summary:||Lis of installed apps set to empty when ImproperlyConfigured exception is raised → List of installed apps set to empty when ImproperlyConfigured exception is raised|