mirror of
https://github.com/jazzband/django-dbtemplates.git
synced 2026-05-23 14:45:53 +00:00
django 1.4 no longer has DATABASE_ENGINE setting, using DATABASE['default']['ENGINE'] instead, if former is not found
This commit is contained in:
parent
832b000c49
commit
530f18142c
1 changed files with 9 additions and 2 deletions
|
|
@ -33,8 +33,15 @@ 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,
|
||||
template_name, site.domain)
|
||||
|
||||
if 'DATABASE_ENGINE' in dir(settings):
|
||||
# DATABASE_ENGINE is in django 1.1, but has been deprecated in Django 1.2
|
||||
display_name = 'dbtemplates:%s:%s:%s' % (settings.DATABASE_ENGINE,
|
||||
template_name, site.domain)
|
||||
else:
|
||||
display_name = 'dbtemplates:%s:%s:%s' % (settings.DATABASES['default']['ENGINE'],
|
||||
template_name, site.domain)
|
||||
|
||||
cache_key = get_cache_key(template_name)
|
||||
if cache:
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue