mirror of
https://github.com/jazzband/django-dbtemplates.git
synced 2026-05-04 13:44:48 +00:00
fix loader for django 1.8
This commit is contained in:
parent
50a877a7d5
commit
15c4a5930b
1 changed files with 8 additions and 1 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue