mirror of https://github.com/django/django.git
Changed core.db to give a friendlier error message if the DATABASE_ENGINE setting is invalid
git-svn-id: http://code.djangoproject.com/svn/django/trunk@160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
272b217557
commit
d4ddc06021
|
@ -15,7 +15,11 @@ let us do that.
|
|||
|
||||
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()
|
||||
|
|
Loading…
Reference in New Issue