Django 1.9 Support

This commit is contained in:
Adnan Umer 2017-04-17 15:52:37 +05:00
parent 090f5b3ef7
commit 8634634b1c
1 changed files with 6 additions and 6 deletions

View File

@ -4,28 +4,28 @@ multi-tenant setting
"""
import hashlib
from django import VERSION as DJANGO_VERSION
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import connection
from django.template import TemplateDoesNotExist
from django.template.base import Template
from django.template.loaders.base import Loader as BaseLoader
from django.utils._os import safe_join
from django.utils.encoding import force_bytes
from tenant_schemas.postgresql_backend.base import FakeTenant
DJANGO_1_10 = DJANGO_VERSION[0] == 1 and DJANGO_VERSION[1] >= 10
DJANGO_1_9 = DJANGO_VERSION[0] == 1 and DJANGO_VERSION[1] >= 9
if DJANGO_1_10:
from django.template import Origin, TemplateDoesNotExist
if DJANGO_1_9:
from django.template import Origin
def make_origin(engine, name, loader, template_name, dirs):
return Origin(name=name, template_name=template_name, loader=loader)
else:
from django.template.base import TemplateDoesNotExist
def make_origin(engine, name, loader, template_name, dirs):
return engine.make_origin(name, loader, template_name, dirs)