Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed core.db to give a friendlier error message if the DATABASE_EN…

…GINE setting is invalid

git-svn-id: http://code.djangoproject.com/svn/django/trunk@160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d4ddc06021a6c39665949111d9e9e9b2c4675ae6 1 parent 272b217
@adrianholovaty adrianholovaty authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 django/core/db/__init__.py
View
6 django/core/db/__init__.py
@@ -15,7 +15,11 @@
from django.conf.settings import DATABASE_ENGINE
-dbmod = __import__('django.core.db.backends.%s' % DATABASE_ENGINE, '', '', [''])
+try:
+ dbmod = __import__('django.core.db.backends.%s' % DATABASE_ENGINE, '', '', [''])
+except ImportError:
+ from django.core.exceptions import ImproperlyConfigured
+ raise ImproperlyConfigured, "Your DATABASE_ENGINE setting, %r, is invalid. Is it spelled correctly?" % DATABASE_ENGINE
DatabaseError = dbmod.DatabaseError
db = dbmod.DatabaseWrapper()
Please sign in to comment.
Something went wrong with that request. Please try again.