From 862f40cfd7a0b8df475b5542c518d7916ce6391e Mon Sep 17 00:00:00 2001 From: Yasuhisa Yamazaki <1@yasu21.net> Date: Tue, 19 May 2015 18:43:51 +0900 Subject: [PATCH] Import TOKEN_BLOCK from django.template.base if Django version is greater than or equal to 1.8. --- linaro_django_pagination/templatetags/pagination_tags.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/linaro_django_pagination/templatetags/pagination_tags.py b/linaro_django_pagination/templatetags/pagination_tags.py index 45857f9..da22e95 100644 --- a/linaro_django_pagination/templatetags/pagination_tags.py +++ b/linaro_django_pagination/templatetags/pagination_tags.py @@ -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 -- 2.20.1