1
0
mirror of https://github.com/django/django.git synced 2025-10-25 06:36:07 +00:00

Fixed #18575 -- Empty DATABASES should default to dummy backend

Thanks delormemarco@gmail.com for the report.
This commit is contained in:
Claude Paroz
2012-10-28 23:02:41 +01:00
parent effe96b303
commit f1cc2be0c5
4 changed files with 22 additions and 8 deletions

View File

@@ -8,7 +8,7 @@ __all__ = ('backend', 'connection', 'connections', 'router', 'DatabaseError',
'IntegrityError', 'DEFAULT_DB_ALIAS')
if DEFAULT_DB_ALIAS not in settings.DATABASES:
if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
raise ImproperlyConfigured("You must define a '%s' database" % DEFAULT_DB_ALIAS)
connections = ConnectionHandler(settings.DATABASES)