jazzband / django-dbtemplates

Django template loader for database stored templates with extensible cache backend

Home Page:https://django-dbtemplates.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django 1.10 - ImportError: cannot import name BaseLoader

cybelew opened this issue · comments

Hi,

The version check in dbtemplates/loader.py is not working for Django 1.10, causing "ImportError: cannot import name BaseLoader"

Currently, it's:

if django.get_version() >= '1.8':
    from django.template.loaders.base import Loader as tLoaderCls
else:
    from django.template.loader import BaseLoader as tLoaderCls  # noqa

This could be fixed by something like the following:

from distutils.version import StrictVersion

if StrictVersion(django.get_version()) >= StrictVersion('1.8'):
    from django.template.loaders.base import Loader as tLoaderCls
else:
    from django.template.loader import BaseLoader as tLoaderCls  # noqa