settings do not include DATABASE_ENGINE in django 1.4

This commit is contained in:
John Fink 2012-04-01 21:31:20 -04:00
parent 33c1197ad1
commit 250afd29f4

View file

@ -33,7 +33,11 @@ class Loader(BaseLoader):
# in the cache indicating that queries failed, with the current
# timestamp.
site = Site.objects.get_current()
display_name = 'dbtemplates:%s:%s:%s' % (settings.DATABASE_ENGINE,
if hasattr(settings,'DATABASES'):
database_engine=settings.DATABASES['default']['ENGINE']
else:
database_engine=settings.DATABASE_ENGINE
display_name = 'dbtemplates:%s:%s:%s' % (database_engine,
template_name, site.domain)
cache_key = get_cache_key(template_name)
if cache: