fix loader for django 1.8

This commit is contained in:
Michael Kutý 2015-04-28 01:03:45 +02:00
parent 50a877a7d5
commit 15c4a5930b

View file

@ -1,3 +1,4 @@
import django
from django.contrib.sites.models import Site
from django.db import router
from django.template import TemplateDoesNotExist
@ -7,8 +8,14 @@ from dbtemplates.utils.cache import (cache, get_cache_key,
set_and_return, get_cache_notfound_key)
from django.template.loader import BaseLoader
if django.get_version() >= '1.8':
from django.template.engine import Engine
from django.template.loaders.base import Loader as tLoaderCls
else:
from django.template.loader import BaseLoader as tLoaderCls # noqa
class Loader(BaseLoader):
class Loader(tLoaderCls):
"""
A custom template loader to load templates from the database.