1
0
mirror of https://github.com/django/django.git synced 2024-12-25 10:35:48 +00:00

Fixed #15336 -- Silenced a warning about the DATABASES transition when a database backend isn't specified. Thanks to Ivan Sagalaev for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15571 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2011-02-19 08:10:19 +00:00
parent c63bc87a98
commit 563a164c05

View File

@ -12,11 +12,12 @@ __all__ = ('backend', 'connection', 'connections', 'router', 'DatabaseError',
# For backwards compatibility - Port any old database settings over to # For backwards compatibility - Port any old database settings over to
# the new values. # the new values.
if not settings.DATABASES: if not settings.DATABASES:
import warnings if settings.DATABASE_ENGINE:
warnings.warn( import warnings
"settings.DATABASE_* is deprecated; use settings.DATABASES instead.", warnings.warn(
DeprecationWarning "settings.DATABASE_* is deprecated; use settings.DATABASES instead.",
) DeprecationWarning
)
settings.DATABASES[DEFAULT_DB_ALIAS] = { settings.DATABASES[DEFAULT_DB_ALIAS] = {
'ENGINE': settings.DATABASE_ENGINE, 'ENGINE': settings.DATABASE_ENGINE,