Skip to content

Commit

Permalink
[1.2.X] Fixed #13610 -- Improved error reporting when the ENGINE sett…
Browse files Browse the repository at this point in the history
…ing 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
  • Loading branch information
freakboy3742 committed Aug 5, 2010
1 parent e10e300 commit 9ff58e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions django/core/management/__init__.py
Expand Up @@ -250,15 +250,15 @@ def fetch_command(self, subcommand):
"""
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):
Expand Down
2 changes: 2 additions & 0 deletions django/db/__init__.py
Expand Up @@ -35,6 +35,8 @@
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:
Expand Down

0 comments on commit 9ff58e3

Please sign in to comment.