summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-08-05 13:19:54 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-08-05 13:19:54 +0000
commit9ff58e30c1aa0ba1888888fcc1c4fd8b7e4254ad (patch)
tree02e7ce43a4f7e791971e7141d4e4d96612a2d9e7
parente10e3007d19ac1feba4d8c124f60446ecb1ace2c (diff)
[1.2.X] 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.
Backport of r13489 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13490 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--AUTHORS1
-rw-r--r--django/core/management/__init__.py10
-rw-r--r--django/db/__init__.py2
3 files changed, 8 insertions, 5 deletions
diff --git a/AUTHORS b/AUTHORS
index 4921f7c3ad..0a7f9db204 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -336,6 +336,7 @@ answer newbie questions, and generally made Django that much better:
Aljosa Mohorovic <aljosa.mohorovic@gmail.com>
Ramiro Morales <rm0@gmx.net>
Eric Moritz <http://eric.themoritzfamily.com/>
+ Gregor Müllegger <gregor@muellegger.de>
Robin Munn <http://www.geekforgod.com/>
James Murty
msundstr
diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
index 32e744374a..85bf324fdc 100644
--- a/django/core/management/__init__.py
+++ b/django/core/management/__init__.py
@@ -250,15 +250,15 @@ class ManagementUtility(object):
"""
try:
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:
sys.stderr.write("Unknown command: %r\nType '%s help' for usage.\n" % \
(subcommand, self.prog_name))
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
def autocomplete(self):
diff --git a/django/db/__init__.py b/django/db/__init__.py
index 4bae04ab9a..4c4faef694 100644
--- a/django/db/__init__.py
+++ b/django/db/__init__.py
@@ -35,6 +35,8 @@ if DEFAULT_DB_ALIAS not in settings.DATABASES:
raise ImproperlyConfigured("You must default a '%s' database" % DEFAULT_DB_ALIAS)
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"):
import warnings
if 'django.contrib.gis' in settings.INSTALLED_APPS: