Merge pull request #27 from amrael/django18
authorZygmunt Krynicki <me@zygoon.pl>
Tue, 19 May 2015 10:24:52 +0000 (12:24 +0200)
committerZygmunt Krynicki <me@zygoon.pl>
Tue, 19 May 2015 10:24:52 +0000 (12:24 +0200)
Django 1.8 Support

linaro_django_pagination/templatetags/pagination_tags.py

index 45857f9..da22e95 100644 (file)
@@ -37,11 +37,16 @@ from django.template import (
     Context,
     Library,
     Node,
-    TOKEN_BLOCK,
     TemplateSyntaxError,
     Variable,
     loader,
 )
+
+try:
+    from django.template.base import TOKEN_BLOCK
+except ImportError:     # Django < 1.8
+    from django.template import TOKEN_BLOCK
+
 from django.template.loader import select_template
 from django.utils.text import unescape_string_literal