summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-10-21 21:21:49 +0200
committerClaude Paroz <claude@2xlibre.net>2013-10-21 21:26:48 +0200
commita098bee1b9fa4df64f3fd72ff5cbae43bf27e539 (patch)
tree9827b4cd49439643287a4ecb365f7a42fe17383d /django
parent86c248aa646183ef4a1cb407bb3e4cb597272f63 (diff)
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.
Diffstat (limited to 'django')
-rw-r--r--django/core/management/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
index 5687cb2bc0..373f9e927e 100644
--- a/django/core/management/__init__.py
+++ b/django/core/management/__init__.py
@@ -249,6 +249,15 @@ class ManagementUtility(object):
usage.append(style.NOTICE("[%s]" % app))
for name in sorted(commands_dict[app]):
usage.append(" %s" % name)
+ # Output an extra note if settings are not properly configured
+ try:
+ from django.conf import settings
+ settings.INSTALLED_APPS
+ except ImproperlyConfigured as e:
+ usage.append(style.NOTICE(
+ "Note that only Django core commands are listed as settings "
+ "are not properly configured (error: %s)." % e))
+
return '\n'.join(usage)
def fetch_command(self, subcommand):