Fixed #13610 -- Improved error reporting when the ENGINE setting is ommitted from a database configuration. Thanks to Gregor Müllegger for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13489 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1050d25096
commit
d75922dad6
1
AUTHORS
1
AUTHORS
|
@ -337,6 +337,7 @@ answer newbie questions, and generally made Django that much better:
|
||||||
Aljosa Mohorovic <aljosa.mohorovic@gmail.com>
|
Aljosa Mohorovic <aljosa.mohorovic@gmail.com>
|
||||||
Ramiro Morales <rm0@gmx.net>
|
Ramiro Morales <rm0@gmx.net>
|
||||||
Eric Moritz <http://eric.themoritzfamily.com/>
|
Eric Moritz <http://eric.themoritzfamily.com/>
|
||||||
|
Gregor Müllegger <gregor@muellegger.de>
|
||||||
Robin Munn <http://www.geekforgod.com/>
|
Robin Munn <http://www.geekforgod.com/>
|
||||||
James Murty
|
James Murty
|
||||||
msundstr
|
msundstr
|
||||||
|
|
|
@ -250,15 +250,15 @@ class ManagementUtility(object):
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
app_name = get_commands()[subcommand]
|
app_name = get_commands()[subcommand]
|
||||||
if isinstance(app_name, BaseCommand):
|
|
||||||
# If the command is already loaded, use it directly.
|
|
||||||
klass = app_name
|
|
||||||
else:
|
|
||||||
klass = load_command_class(app_name, subcommand)
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
sys.stderr.write("Unknown command: %r\nType '%s help' for usage.\n" % \
|
sys.stderr.write("Unknown command: %r\nType '%s help' for usage.\n" % \
|
||||||
(subcommand, self.prog_name))
|
(subcommand, self.prog_name))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
if isinstance(app_name, BaseCommand):
|
||||||
|
# If the command is already loaded, use it directly.
|
||||||
|
klass = app_name
|
||||||
|
else:
|
||||||
|
klass = load_command_class(app_name, subcommand)
|
||||||
return klass
|
return klass
|
||||||
|
|
||||||
def autocomplete(self):
|
def autocomplete(self):
|
||||||
|
|
|
@ -35,6 +35,8 @@ if DEFAULT_DB_ALIAS not in settings.DATABASES:
|
||||||
raise ImproperlyConfigured("You must default a '%s' database" % DEFAULT_DB_ALIAS)
|
raise ImproperlyConfigured("You must default a '%s' database" % DEFAULT_DB_ALIAS)
|
||||||
|
|
||||||
for alias, database in settings.DATABASES.items():
|
for alias, database in settings.DATABASES.items():
|
||||||
|
if 'ENGINE' not in database:
|
||||||
|
raise ImproperlyConfigured("You must specify a 'ENGINE' for database '%s'" % alias)
|
||||||
if database['ENGINE'] in ("postgresql", "postgresql_psycopg2", "sqlite3", "mysql", "oracle"):
|
if database['ENGINE'] in ("postgresql", "postgresql_psycopg2", "sqlite3", "mysql", "oracle"):
|
||||||
import warnings
|
import warnings
|
||||||
if 'django.contrib.gis' in settings.INSTALLED_APPS:
|
if 'django.contrib.gis' in settings.INSTALLED_APPS:
|
||||||
|
|
Loading…
Reference in New Issue