1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

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.
This commit is contained in:
Claude Paroz
2013-10-21 21:21:49 +02:00
parent 86c248aa64
commit a098bee1b9
2 changed files with 20 additions and 0 deletions

View File

@@ -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):