[Python-modules-commits] [django-jinja] 01/03: Import django-jinja_2.1.2.orig.tar.gz
Edward Betts
edward at moszumanska.debian.org
Sun Feb 21 08:59:52 UTC 2016
This is an automated email from the git hooks/post-receive script.
edward pushed a commit to branch master
in repository django-jinja.
commit d67b9ad26515e92a4200a2392445c32285d04ae8
Author: Edward Betts <edward at 4angle.com>
Date: Sun Feb 21 08:50:47 2016 +0000
Import django-jinja_2.1.2.orig.tar.gz
---
PKG-INFO | 2 +-
README.rst | 2 +-
django_jinja.egg-info/PKG-INFO | 2 +-
django_jinja/backend.py | 8 +++++++-
django_jinja/builtins/extensions.py | 2 ++
django_jinja/cache.py | 8 ++------
django_jinja/utils.py | 4 ++++
setup.cfg | 2 +-
setup.py | 2 +-
9 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index db4b6f5..06ff406 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: django-jinja
-Version: 2.1.1
+Version: 2.1.2
Summary: Jinja2 templating language integrated in Django.
Home-page: https://github.com/niwinz/django-jinja
Author: Andrey Antukh
diff --git a/README.rst b/README.rst
index 0d095c2..7e40190 100644
--- a/README.rst
+++ b/README.rst
@@ -16,7 +16,7 @@ Simple and nonobstructive jinja2 integration with Django.
:target: https://pypi.python.org/pypi/django-jinja
-**Documentation:** http://niwinz.github.io/django-jinja/
+**Documentation:** http://niwinz.github.io/django-jinja/latest/
How to install?
diff --git a/django_jinja.egg-info/PKG-INFO b/django_jinja.egg-info/PKG-INFO
index db4b6f5..06ff406 100644
--- a/django_jinja.egg-info/PKG-INFO
+++ b/django_jinja.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: django-jinja
-Version: 2.1.1
+Version: 2.1.2
Summary: Jinja2 templating language integrated in Django.
Home-page: https://github.com/niwinz/django-jinja
Author: Andrey Antukh
diff --git a/django_jinja/backend.py b/django_jinja/backend.py
index 0088ee8..8fb0ad4 100644
--- a/django_jinja/backend.py
+++ b/django_jinja/backend.py
@@ -276,9 +276,15 @@ class Jinja2(BaseEngine):
try:
return Template(self.env.get_template(template_name), self)
except jinja2.TemplateNotFound as exc:
+
+ if utils.DJANGO_18:
+ exc = TemplateDoesNotExist(exc.name)
+ else:
+ exc = TemplateDoesNotExist(exc.name, backend=self)
+
six.reraise(
TemplateDoesNotExist,
- TemplateDoesNotExist(exc.name, backend=self),
+ exc,
sys.exc_info()[2],
)
except jinja2.TemplateSyntaxError as exc:
diff --git a/django_jinja/builtins/extensions.py b/django_jinja/builtins/extensions.py
index 65520e0..a462e9d 100644
--- a/django_jinja/builtins/extensions.py
+++ b/django_jinja/builtins/extensions.py
@@ -133,6 +133,8 @@ class CacheExtension(Extension):
if value is None:
value = caller()
cache.set(cache_key, force_text(value), expire_time)
+ else:
+ value = force_text(value)
return value
diff --git a/django_jinja/cache.py b/django_jinja/cache.py
index 5223ce3..bd0a080 100644
--- a/django_jinja/cache.py
+++ b/django_jinja/cache.py
@@ -14,12 +14,8 @@ class BytecodeCache(_BytecodeCache):
@cached_property
def backend(self):
- if django.VERSION[:2] < (1, 8):
- from django.core.cache import get_cache
- return get_cache(self._cache_name)
- else:
- from django.core.cache import caches
- return caches[self._cache_name]
+ from django.core.cache import caches
+ return caches[self._cache_name]
def load_bytecode(self, bucket):
key = 'jinja2_%s' % str(bucket.key)
diff --git a/django_jinja/utils.py b/django_jinja/utils.py
index 7b8ab16..21640b5 100644
--- a/django_jinja/utils.py
+++ b/django_jinja/utils.py
@@ -3,10 +3,14 @@
import functools
from importlib import import_module
+import django
from django.utils.safestring import mark_safe
from django.core.exceptions import ImproperlyConfigured
+DJANGO_18 = (django.VERSION[:2] == (1, 8))
+
+
def load_class(path):
"""
Load class from path.
diff --git a/setup.cfg b/setup.cfg
index 861a9f5..a669c45 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
[egg_info]
+tag_svn_revision = 0
tag_build =
tag_date = 0
-tag_svn_revision = 0
diff --git a/setup.py b/setup.py
index a519630..f94237e 100644
--- a/setup.py
+++ b/setup.py
@@ -15,7 +15,7 @@ if sys.version_info < (2, 7):
setup(
name = "django-jinja",
- version = "2.1.1",
+ version = "2.1.2",
description = "Jinja2 templating language integrated in Django.",
long_description = "",
keywords = "django, jinja2",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-jinja.git
More information about the Python-modules-commits
mailing list