[Django 1.9] Update template.base.Library() import

Adds a wrapper for Django 1.9 for the usage of the Library() function,
as the import path has changed.

Change-Id: I93c37bfaef6bc29c85d2e6a570cf552d685f711e
Partially-implements: blueprint drop-dj17
This commit is contained in:
Rob Cresswell 2016-01-18 16:35:59 +00:00
parent 1305ccf561
commit 94515a0720

View File

@ -10,11 +10,15 @@
# License for the specific language governing permissions and limitations
# under the License.
from django.template import base
import django
from django import template
from django.template import defaultfilters
from django.utils import safestring
register = base.Library()
if django.VERSION >= (1, 9):
register = template.Library()
else:
register = template.base.Library()
@register.filter(is_safe=True)