mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #18545 -- Make the 'no DJANGO_SETTINGS_MODULE' error message more useful.Thanks Nick Coghlan for the report, and Malcolm Tredinnick for review.
This commit is contained in:
@@ -5,6 +5,7 @@ from optparse import OptionParser, NO_DEFAULT
|
||||
import imp
|
||||
import warnings
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.core.management.base import BaseCommand, CommandError, handle_default_options
|
||||
from django.core.management.color import color_style
|
||||
from django.utils.importlib import import_module
|
||||
@@ -105,7 +106,7 @@ def get_commands():
|
||||
try:
|
||||
from django.conf import settings
|
||||
apps = settings.INSTALLED_APPS
|
||||
except (AttributeError, EnvironmentError, ImportError):
|
||||
except (AttributeError, ImproperlyConfigured):
|
||||
apps = []
|
||||
|
||||
# Find and load the management module for each installed app.
|
||||
|
||||
Reference in New Issue
Block a user