Hello community,
here is the log from the commit of package python-django-jinja for
openSUSE:Factory checked in at 2020-02-20 14:59:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django-jinja (Old)
and /work/SRC/openSUSE:Factory/.python-django-jinja.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-jinja"
Thu Feb 20 14:59:12 2020 rev:2 rq:777593 version:2.6.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-django-jinja/python-django-jinja.changes
2018-08-08 14:54:56.433692772 +0200
+++
/work/SRC/openSUSE:Factory/.python-django-jinja.new.26092/python-django-jinja.changes
2020-02-20 14:59:17.782749093 +0100
@@ -1,0 +2,6 @@
+Thu Feb 20 08:29:11 UTC 2020 - Tomáš Chvátal <[email protected]>
+
+- Update to 2.6.0:
+ * Fix compatibility issues with Django 3.0, minimum version now 1.11.
+
+-------------------------------------------------------------------
Old:
----
2.4.1.tar.gz
New:
----
2.6.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-django-jinja.spec ++++++
--- /var/tmp/diff_new_pack.ZioBSE/_old 2020-02-20 14:59:18.390750286 +0100
+++ /var/tmp/diff_new_pack.ZioBSE/_new 2020-02-20 14:59:18.390750286 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-django-jinja
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,27 +12,26 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-django-jinja
-Version: 2.4.1
+Version: 2.6.0
Release: 0
Summary: Jinja2 templating language integrated in Django
License: BSD-3-Clause
-Group: Development/Languages/Python
URL: https://github.com/niwinz/django-jinja
Source:
https://github.com/niwinz/django-jinja/archive/%{version}.tar.gz
-BuildRequires: %{python_module Django >= 1.8}
+BuildRequires: %{python_module Django >= 1.11}
BuildRequires: %{python_module Jinja2 >= 2.5}
BuildRequires: %{python_module pytz}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python2-mock
-Requires: python-Django >= 1.8
+Requires: python-Django >= 1.11
Requires: python-Jinja2 >= 2.5
BuildArch: noarch
%python_subpackages
++++++ 2.4.1.tar.gz -> 2.6.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/.travis.yml
new/django-jinja-2.6.0/.travis.yml
--- old/django-jinja-2.4.1/.travis.yml 2017-11-24 11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/.travis.yml 2020-02-01 04:59:29.000000000 +0100
@@ -1,23 +1,33 @@
language: python
sudo: false
+cache: pip
-python:
- - "3.6"
- - "3.5"
- - "3.4"
- - "2.7"
-
-env:
- - DJANGO="django==1.8.18"
- - DJANGO="django==1.9.13"
- - DJANGO="django==1.10.7"
- - DJANGO="django==1.11"
+matrix:
+ include:
+ - python: 3.5
+ env: TOXENV=py35-django111
+ - python: 3.6
+ env: TOXENV=py36-django111
+ - python: 3.5
+ env: TOXENV=py35-django22
+ - python: 3.6
+ env: TOXENV=py36-django22
+ - python: 3.7
+ env: TOXENV=py37-django22
+ - python: 3.8
+ env: TOXENV=py38-django22
+ - python: 3.6
+ env: TOXENV=py36-django30
+ - python: 3.7
+ env: TOXENV=py37-django30
+ - python: 3.8
+ env: TOXENV=py38-django30
install:
- - pip install $DJANGO jinja2 "django-pipeline<1.6" pytz mock
+ - pip install tox
script:
- - cd testing && python runtests.py
+ - tox
notifications:
email:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/CHANGES.adoc
new/django-jinja-2.6.0/CHANGES.adoc
--- old/django-jinja-2.4.1/CHANGES.adoc 2017-11-24 11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/CHANGES.adoc 2020-02-01 04:59:29.000000000 +0100
@@ -1,6 +1,19 @@
Changelog
=========
+Version 2.5.0
+-------------
+
+- Fix compatibility issues with Django 3.0, minimum version now 1.11.
+- Dropped support for Python 2.7, 3.4, adding support through 3.8.
+
+
+Version 2.4.2
+-------------
+
+- Added `Template.stream` method to use with StreamingHttpResponse.
+
+
Version 2.4.1
-------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/django_jinja/backend.py
new/django-jinja-2.6.0/django_jinja/backend.py
--- old/django-jinja-2.4.1/django_jinja/backend.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/django_jinja/backend.py 2020-02-01
04:59:29.000000000 +0100
@@ -7,12 +7,11 @@
django_jinja easy with django 1.8.
"""
-from __future__ import absolute_import
-
import copy
import sys
import os
import os.path as path
+import functools
from importlib import import_module
import jinja2
@@ -28,8 +27,6 @@
from django.template.backends.utils import csrf_input_lazy
from django.template.backends.utils import csrf_token_lazy
from django.template.context import BaseContext
-from django.utils import lru_cache
-from django.utils import six
from django.utils.encoding import smart_text
from django.utils.functional import SimpleLazyObject
from django.utils.functional import cached_property
@@ -63,6 +60,12 @@
)
def render(self, context=None, request=None):
+ return mark_safe(self._process_template(self.template.render, context,
request))
+
+ def stream(self, context=None, request=None):
+ return self._process_template(self.template.stream, context, request)
+
+ def _process_template(self, handler, context=None, request=None):
if context is None:
context = {}
@@ -103,14 +106,14 @@
template=self,
context=context)
- return mark_safe(self.template.render(context))
+ return handler(context)
class Jinja2(BaseEngine):
app_dirname = "templates"
@staticmethod
- @lru_cache.lru_cache()
+ @functools.lru_cache()
def get_default():
"""
When only one django-jinja backend is configured, returns it.
@@ -161,7 +164,7 @@
undefined = options.pop("undefined", None)
if undefined is not None:
- if isinstance(undefined, six.string_types):
+ if isinstance(undefined, str):
options["undefined"] = utils.load_class(undefined)
else:
options["undefined"] = undefined
@@ -173,7 +176,7 @@
environment_cls = import_string(environment_clspath)
- if isinstance(options.get("loader"), six.string_types):
+ if isinstance(options.get("loader"), str):
# Allow to specify a loader as string
loader_cls = import_string(options.pop("loader"))
else:
@@ -237,7 +240,7 @@
def _initialize_builtins(self, filters=None, tests=None, globals=None,
constants=None):
def insert(data, name, value):
- if isinstance(value, six.string_types):
+ if isinstance(value, str):
data[name] = import_string(value)
else:
data[name] = value
@@ -288,7 +291,7 @@
else:
exc = TemplateDoesNotExist(exc.name, backend=self)
- six.reraise(
+ utils.reraise(
TemplateDoesNotExist,
exc,
sys.exc_info()[2],
@@ -296,7 +299,7 @@
except jinja2.TemplateSyntaxError as exc:
new = TemplateSyntaxError(exc.args)
new.template_debug = get_exception_info(exc)
- six.reraise(TemplateSyntaxError, new, sys.exc_info()[2])
+ utils.reraise(TemplateSyntaxError, new, sys.exc_info()[2])
@receiver(signals.setting_changed)
@@ -313,7 +316,13 @@
"""
context_lines = 10
lineno = exception.lineno
- lines = list(enumerate(exception.source.strip().split("\n"), start=1))
+ if exception.source is None:
+ if os.path.exists(exception.filename):
+ with open(exception.filename, "r") as f:
+ source = f.read()
+ else:
+ source = exception.source
+ lines = list(enumerate(source.strip().split("\n"), start=1))
during = lines[lineno - 1][1]
total = len(lines)
top = max(0, lineno - context_lines - 1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/django_jinja/base.py
new/django-jinja-2.6.0/django_jinja/base.py
--- old/django-jinja-2.4.1/django_jinja/base.py 2017-11-24 11:51:14.000000000
+0100
+++ new/django-jinja-2.6.0/django_jinja/base.py 2020-02-01 04:59:29.000000000
+0100
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import re
import os
import os.path as path
@@ -8,7 +6,6 @@
import django
from django.conf import settings
from django.template.context import BaseContext
-from django.utils import six
def dict_from_context(context):
@@ -38,7 +35,7 @@
mod = import_module(app_path + ".templatetags")
# Empty folders can lead to unexpected behavior with Python 3.
# We make sure to have the `__file__` attribute.
- if hasattr(mod, '__file__'):
+ if getattr(mod, '__file__', None) is not None:
yield (app_path, path.dirname(mod.__file__))
except ImportError:
pass
@@ -56,28 +53,28 @@
if hasattr(safestring, "SafeText"):
if not hasattr(safestring.SafeText, "__html__"):
- safestring.SafeText.__html__ = lambda self: six.text_type(self)
+ safestring.SafeText.__html__ = lambda self: str(self)
if hasattr(safestring, "SafeString"):
if not hasattr(safestring.SafeString, "__html__"):
- safestring.SafeString.__html__ = lambda self: six.text_type(self)
+ safestring.SafeString.__html__ = lambda self: str(self)
if hasattr(safestring, "SafeUnicode"):
if not hasattr(safestring.SafeUnicode, "__html__"):
- safestring.SafeUnicode.__html__ = lambda self: six.text_type(self)
+ safestring.SafeUnicode.__html__ = lambda self: str(self)
if hasattr(safestring, "SafeBytes"):
if not hasattr(safestring.SafeBytes, "__html__"):
- safestring.SafeBytes.__html__ = lambda self: six.text_type(self)
+ safestring.SafeBytes.__html__ = lambda self: str(self)
if not hasattr(BoundField, "__html__"):
- BoundField.__html__ = lambda self: six.text_type(self)
+ BoundField.__html__ = lambda self: str(self)
if not hasattr(ErrorList, "__html__"):
- ErrorList.__html__ = lambda self: six.text_type(self)
+ ErrorList.__html__ = lambda self: str(self)
if not hasattr(ErrorDict, "__html__"):
- ErrorDict.__html__ = lambda self: six.text_type(self)
+ ErrorDict.__html__ = lambda self: str(self)
def get_match_extension(using=None):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/django_jinja/builtins/__init__.py
new/django-jinja-2.6.0/django_jinja/builtins/__init__.py
--- old/django-jinja-2.4.1/django_jinja/builtins/__init__.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/django_jinja/builtins/__init__.py 2020-02-01
04:59:29.000000000 +0100
@@ -4,6 +4,7 @@
"jinja2.ext.with_",
"jinja2.ext.i18n",
"jinja2.ext.autoescape",
+ "django_jinja.builtins.extensions.DebugExtension",
"django_jinja.builtins.extensions.CsrfExtension",
"django_jinja.builtins.extensions.CacheExtension",
"django_jinja.builtins.extensions.TimezoneExtension",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/django_jinja/builtins/extensions.py
new/django-jinja-2.6.0/django_jinja/builtins/extensions.py
--- old/django-jinja-2.4.1/django_jinja/builtins/extensions.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/django_jinja/builtins/extensions.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,12 +1,13 @@
-from __future__ import unicode_literals
-
-import traceback
import logging
+import pprint
+import sys
import django
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.cache import cache
+from jinja2.nodes import ContextReference
+
try:
from django.urls import NoReverseMatch
from django.urls import reverse
@@ -19,15 +20,16 @@
from django.utils.translation import ugettext
from jinja2 import Markup
from jinja2 import TemplateSyntaxError
+from jinja2 import contextfunction
from jinja2 import lexer
from jinja2 import nodes
from jinja2.ext import Extension
try:
- from django.utils.encoding import force_text
+ from django.utils.encoding import force_str
from django.utils.encoding import force_bytes
except ImportError:
- from django.utils.encoding import force_unicode as force_text
+ from django.utils.encoding import force_unicode as force_str
from django.utils.encoding import smart_str as force_bytes
@@ -137,12 +139,66 @@
value = cache.get(cache_key)
if value is None:
value = caller()
- cache.set(cache_key, force_text(value), expire_time)
+ cache.set(cache_key, force_str(value), expire_time)
else:
- value = force_text(value)
+ value = force_str(value)
return value
+
+class DebugExtension(Extension):
+ """
+ A ``{% debug %}`` tag that dumps the available variables, filters and
tests.
+ Typical usage like this:
+
+ .. codeblock:: html+jinja
+ <pre>{% debug %}</pre>
+
+ produces output like this:
+
+ ::
+ {'context': {'_': <function _gettext_alias at 0x7f9ceabde488>,
+ 'csrf_token': <SimpleLazyObject: 'lfPE7al...q3bykS4txKfb3'>,
+ 'cycler': <class 'jinja2.utils.Cycler'>,
+ ...
+ 'view': <polls.views_auth.Login object at 0x7f9cea2cbe48>},
+ 'filters': ['abs', 'add', 'addslashes', 'attr', 'batch', 'bootstrap',
+ 'bootstrap_classes', 'bootstrap_horizontal',
+ 'bootstrap_inline', ... 'yesno'],
+ 'tests': ['callable', 'checkbox_field', 'defined', 'divisibleby',
+ 'escaped', 'even', 'iterable', 'lower', 'mapping',
+ 'multiple_checkbox_field', ... 'string', 'undefined', 'upper']}
+
+ """
+ tags = set(['debug'])
+
+ def __init__(self, environment):
+ super(DebugExtension, self).__init__(environment)
+
+ def parse(self, parser):
+ lineno = parser.stream.expect('name:debug').lineno
+ context = ContextReference()
+ call = self.call_method('_render', [context], lineno=lineno)
+ return nodes.Output([nodes.MarkSafe(call)])
+
+ def _render(self, context):
+ result = {
+ 'filters': sorted(self.environment.filters.keys()),
+ 'tests': sorted(self.environment.tests.keys()),
+ 'context': context.get_all()
+ }
+ #
+ # We set the depth since the intent is basically to show the top few
+ # names. TODO: provide user control over this?
+ #
+ if sys.version_info[:2] >= (3, 4):
+ text = pprint.pformat(result, depth=3, compact=True)
+ else:
+ text = pprint.pformat(result, depth=3)
+ text = Markup.escape(text)
+ return text
+
+
class StaticFilesExtension(Extension):
def __init__(self, environment):
super(StaticFilesExtension, self).__init__(environment)
@@ -157,9 +213,19 @@
super(UrlsExtension, self).__init__(environment)
environment.globals["url"] = self._url_reverse
- def _url_reverse(self, name, *args, **kwargs):
+ @contextfunction
+ def _url_reverse(self, context, name, *args, **kwargs):
+ try:
+ current_app = context["request"].current_app
+ except AttributeError:
+ try:
+ current_app = context["request"].resolver_match.namespace
+ except AttributeError:
+ current_app = None
+ except KeyError:
+ current_app = None
try:
- return reverse(name, args=args, kwargs=kwargs)
+ return reverse(name, args=args, kwargs=kwargs,
current_app=current_app)
except NoReverseMatch as exc:
logger.error('Error: %s', exc)
if not JINJA2_MUTE_URLRESOLVE_EXCEPTIONS:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/django_jinja/builtins/filters.py
new/django-jinja-2.6.0/django_jinja/builtins/filters.py
--- old/django-jinja-2.4.1/django_jinja/builtins/filters.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/django_jinja/builtins/filters.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,9 +1,7 @@
-# -*- coding: utf-8 -*-
-
try:
- from django.utils.encoding import force_text
+ from django.utils.encoding import force_str
except ImportError:
- from django.utils.encoding import force_unicode as force_text
+ from django.utils.encoding import force_unicode as force_str
try:
from django.urls import reverse as django_reverse
@@ -81,7 +79,7 @@
from django.template.defaultfilters import slugify as djslugify
def slugify(value):
- return djslugify(force_text(value))
+ return djslugify(force_str(value))
from functools import partial
linebreaksbr = partial(linebreaksbr, autoescape=True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/django_jinja/cache.py
new/django-jinja-2.6.0/django_jinja/cache.py
--- old/django-jinja-2.4.1/django_jinja/cache.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/django_jinja/cache.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
import django
from django.utils.functional import cached_property
from jinja2 import BytecodeCache as _BytecodeCache
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/django_jinja/contrib/_easy_thumbnails/templatetags/thumbnails.py
new/django-jinja-2.6.0/django_jinja/contrib/_easy_thumbnails/templatetags/thumbnails.py
---
old/django-jinja-2.4.1/django_jinja/contrib/_easy_thumbnails/templatetags/thumbnails.py
2017-11-24 11:51:14.000000000 +0100
+++
new/django-jinja-2.6.0/django_jinja/contrib/_easy_thumbnails/templatetags/thumbnails.py
2020-02-01 04:59:29.000000000 +0100
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
import logging
from easy_thumbnails.conf import settings
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/django_jinja/contrib/_humanize/templatetags/_humanize.py
new/django-jinja-2.6.0/django_jinja/contrib/_humanize/templatetags/_humanize.py
---
old/django-jinja-2.4.1/django_jinja/contrib/_humanize/templatetags/_humanize.py
2017-11-24 11:51:14.000000000 +0100
+++
new/django-jinja-2.6.0/django_jinja/contrib/_humanize/templatetags/_humanize.py
2020-02-01 04:59:29.000000000 +0100
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
from django.contrib.humanize.templatetags import humanize
from django_jinja import library
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/django_jinja/contrib/_pipeline/templatetags/_pipeline.py
new/django-jinja-2.6.0/django_jinja/contrib/_pipeline/templatetags/_pipeline.py
---
old/django-jinja-2.4.1/django_jinja/contrib/_pipeline/templatetags/_pipeline.py
2017-11-24 11:51:14.000000000 +0100
+++
new/django-jinja-2.6.0/django_jinja/contrib/_pipeline/templatetags/_pipeline.py
2020-02-01 04:59:29.000000000 +0100
@@ -1,7 +1,3 @@
-# -*- coding: utf-8 -*-
-
-from __future__ import unicode_literals, absolute_import
-
import jinja2
from django.contrib.staticfiles.storage import staticfiles_storage
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/django_jinja/contrib/_subdomains/templatetags/subdomainurls.py
new/django-jinja-2.6.0/django_jinja/contrib/_subdomains/templatetags/subdomainurls.py
---
old/django-jinja-2.4.1/django_jinja/contrib/_subdomains/templatetags/subdomainurls.py
2017-11-24 11:51:14.000000000 +0100
+++
new/django-jinja-2.6.0/django_jinja/contrib/_subdomains/templatetags/subdomainurls.py
2020-02-01 04:59:29.000000000 +0100
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
from django_jinja import library
from jinja2 import contextfunction
from subdomains.templatetags.subdomainurls import url as subdomain_url
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/django_jinja/utils.py
new/django-jinja-2.6.0/django_jinja/utils.py
--- old/django-jinja-2.4.1/django_jinja/utils.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/django_jinja/utils.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import functools
from importlib import import_module
@@ -36,3 +34,11 @@
return mark_safe(function(*args, **kwargs))
return _decorator
+
+def reraise(tp, value, tb=None):
+ if value is None:
+ value = tp()
+ if value.__traceback__ is not tb:
+ raise value.with_traceback(tb)
+ raise value
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/django_jinja/views/__init__.py
new/django-jinja-2.6.0/django_jinja/views/__init__.py
--- old/django-jinja-2.4.1/django_jinja/views/__init__.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/django_jinja/views/__init__.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,11 +1,13 @@
-# -*- coding: utf-8 -*-
-
import django
-
-from django.conf import settings
-from django.views.generic import View
-from django.template import loader, RequestContext
from django import http
+from django.template import RequestContext, loader
+
+try:
+ from django.views import View
+except ImportError:
+ from django.views.generic import View
+
+from ..base import get_match_extension
class GenericView(View):
@@ -18,11 +20,13 @@
def get(self, request, *args, **kwargs):
context = self.get_context_data()
+ template_name = callable(self.tmpl_name) and self.tmpl_name() or
self.tmpl_name
+
if django.VERSION[:2] < (1, 8):
- output = loader.render_to_string(self.tmpl_name, context,
+ output = loader.render_to_string(template_name, context,
context_instance=RequestContext(request))
else:
- output = loader.render_to_string(self.tmpl_name, context,
request=request)
+ output = loader.render_to_string(template_name, context,
request=request)
return self.response_cls(output, content_type=self.content_type)
@@ -48,20 +52,28 @@
class PageNotFound(ErrorView):
- tmpl_name = "404" + getattr(settings, 'DEFAULT_JINJA2_TEMPLATE_EXTENSION',
'.jinja')
response_cls = http.HttpResponseNotFound
+ def tmpl_name(self):
+ return "404" + (get_match_extension() or ".jinja")
+
class PermissionDenied(ErrorView):
- tmpl_name = "403" + getattr(settings, 'DEFAULT_JINJA2_TEMPLATE_EXTENSION',
'.jinja')
response_cls = http.HttpResponseForbidden
+ def tmpl_name(self):
+ return "403" + (get_match_extension() or ".jinja")
+
class BadRequest(ErrorView):
- tmpl_name = "400" + getattr(settings, 'DEFAULT_JINJA2_TEMPLATE_EXTENSION',
'.jinja')
response_cls = http.HttpResponseBadRequest
+ def tmpl_name(self):
+ return "400" + (get_match_extension() or ".jinja")
+
class ServerError(ErrorView):
- tmpl_name = "500" + getattr(settings, 'DEFAULT_JINJA2_TEMPLATE_EXTENSION',
'.jinja')
response_cls = http.HttpResponseServerError
+
+ def tmpl_name(self):
+ return "500" + (get_match_extension() or ".jinja")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/django_jinja/views/generic/base.py
new/django-jinja-2.6.0/django_jinja/views/generic/base.py
--- old/django-jinja-2.4.1/django_jinja/views/generic/base.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/django_jinja/views/generic/base.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
from ...base import get_match_extension
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/django_jinja/views/generic/dates.py
new/django-jinja-2.6.0/django_jinja/views/generic/dates.py
--- old/django-jinja-2.4.1/django_jinja/views/generic/dates.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/django_jinja/views/generic/dates.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
from django.views.generic.dates import ArchiveIndexView as
_django_ArchiveIndexView
from django.views.generic.dates import YearArchiveView as
_django_YearArchiveView
from django.views.generic.dates import MonthArchiveView as
_django_MonthArchiveView
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/django_jinja/views/generic/detail.py
new/django-jinja-2.6.0/django_jinja/views/generic/detail.py
--- old/django-jinja-2.4.1/django_jinja/views/generic/detail.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/django_jinja/views/generic/detail.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
from django.views.generic.detail import DetailView as _django_DetailView
from .base import Jinja2TemplateResponseMixin
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/django_jinja/views/generic/edit.py
new/django-jinja-2.6.0/django_jinja/views/generic/edit.py
--- old/django-jinja-2.4.1/django_jinja/views/generic/edit.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/django_jinja/views/generic/edit.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
from django.views.generic.edit import CreateView as _django_CreateView
from django.views.generic.edit import DeleteView as _django_DeleteView
from django.views.generic.edit import UpdateView as _django_UpdateView
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/django_jinja/views/generic/list.py
new/django-jinja-2.6.0/django_jinja/views/generic/list.py
--- old/django-jinja-2.4.1/django_jinja/views/generic/list.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/django_jinja/views/generic/list.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
from django.views.generic.list import ListView as _django_ListView
from .base import Jinja2TemplateResponseMixin
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/doc/content.adoc
new/django-jinja-2.6.0/doc/content.adoc
--- old/django-jinja-2.4.1/doc/content.adoc 2017-11-24 11:51:14.000000000
+0100
+++ new/django-jinja-2.6.0/doc/content.adoc 2020-02-01 04:59:29.000000000
+0100
@@ -10,7 +10,7 @@
== Introduction
-django-jinja is a xref:license[BSD Licensed], simple and nonobstructive jinja2
+django-jinja is a xref:license[BSD Licensed], simple and non-obstructive jinja2
backend for Django.
@@ -23,9 +23,9 @@
Django comes with a jinja backend, why should I use *django-jinja*?
The Django builtin backend has a very limited set of features if we compare it
with
-the django template engine and in my opion is not very usable because it does
not
+the django template engine and in my opinion is not very usable because it
does not
integrate well with the rest of django such as its filters, template tags and
-preloading of templatetags among others.
+preloading of templatetags, among others.
*django-jinja* comes to the rescue and adds everything missing. This is a brief
list of differences with django's built-in backend:
@@ -38,7 +38,7 @@
- Django template filters and tags can mostly be used in Jinja2 templates.
- I18n subsystem adapted for Jinja2 (makemessages now collects messages from
Jinja templates)
-- Compatible with python2 and python3 using same codebase.
+- Compatible with python2 and python3 using the same codebase.
- jinja2 bytecode cache adapted for using django's cache subsystem.
- Support for django context processors.
@@ -53,11 +53,27 @@
=== Requirements
-- Python 2.7, 3.4 and 3.5
-- Django >= 1.8
+- Python >= 3.5
+- Django >= 1.11
- jinja2 >= 2.7.0
-*If you are using django < 1.8, you should use django-jinja 1.x versions.*
+If you are using older versions of Django or Python, you need an older version
of django-jinja:
+
+|===
+|django-jinja |supported python versions |supported django versions
+
+|==1.4.2
+|2.7, 3.3, 3.4
+|1.5, 1.6, 1.7, 1.8
+
+|==2.4.1
+|2.7, 3.4, 3.5
+|1.8, 1.11
+
+|>=2.5.0
+|3.5 (not django 3.0), 3.6, 3.7, 3.8
+|1.11, 2.2, 3.0
+|===
=== Installation
@@ -72,7 +88,7 @@
== Quick Start
-Add it to django installed apps list:
+Add it to Django's installed apps list:
[source, python]
----
@@ -114,8 +130,8 @@
=== Regex based template matching
-By default, *django-jinja* uses the extension as method to match templates,
but if
-it is not enough, you can extend it using regular experessions:
+By default, *django-jinja* uses the file extension as the method to match
+templates, but if it is not enough, you can extend it using regular
expressions:
[source, python]
----
@@ -140,7 +156,7 @@
It is a helper to use django's context processors with jinja2 backend
for django 1.8.
-.Example setup a bunch of context processors:
+.Example: set up a bunch of context processors:
[source, python]
----
"OPTIONS": {
@@ -163,8 +179,8 @@
[NOTE]
====
-Remeber that django (1.8.x and 1.9.x) is backward compatibile with
-the old template api and this has its own tradeoffs. If you find yourself
using functions
+Remember that django (1.8.x and 1.9.x) is backward compatible with
+the old template api and this has its own trade-offs. If you find yourself
using functions
like `render_to_string` or `render_to_response` from django, do not forget to
pass the
request parameter in order to make context processors work.
====
@@ -196,7 +212,7 @@
=== Add additional extensions
django-jinja, by default sets up a great amount of extensions to make your
experience
-using jinja in django painless. But if you want to add more extesions, you can
do it
+using jinja in django painless. But if you want to add more extensions, you
can do it
using the `extensions` entry of the backend options:
[source, python]
@@ -284,6 +300,7 @@
"jinja2.ext.autoescape",
"django_jinja.builtins.extensions.CsrfExtension",
"django_jinja.builtins.extensions.CacheExtension",
+ "django_jinja.builtins.extensions.DebugExtension",
"django_jinja.builtins.extensions.TimezoneExtension",
"django_jinja.builtins.extensions.UrlsExtension",
"django_jinja.builtins.extensions.StaticFilesExtension",
@@ -367,7 +384,7 @@
join, length, random, default, filesizeformat, pprint.
-=== Registring filters in a "django" way.
+=== Registering filters in a "django" way.
django-jinja comes with facilities for loading template filters, globals and
tests
from django applications.
@@ -426,6 +443,7 @@
library.extension(MyExtension)
----
+This only works within a Django app. If you don't have an app for your
project, create an app specifically for this purpose and put your templatetags
there.
=== Render 4xx/500 pages with jinja
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/setup.py
new/django-jinja-2.6.0/setup.py
--- old/django-jinja-2.4.1/setup.py 2017-11-24 11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/setup.py 2020-02-01 04:59:29.000000000 +0100
@@ -1,13 +1,12 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
from setuptools import setup
import sys
INSTALL_REQUIRES = [
- "jinja2 >=2.5",
- "django >=1.8",
+ "jinja2 >=2.10",
+ "django >=1.11, <3.1",
]
if sys.version_info < (2, 7):
@@ -15,12 +14,12 @@
setup(
name = "django-jinja",
- version = "2.4.1",
+ version = "2.6.0",
description = "Jinja2 templating language integrated in Django.",
long_description = "",
keywords = "django, jinja2",
author = "Andrey Antukh",
- author_email = "[email protected]",
+ author_email = "[email protected]",
url = "https://github.com/niwinz/django-jinja",
license = "BSD",
packages = [
@@ -53,13 +52,11 @@
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
- "Programming Language :: Python :: 2",
- "Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.3",
- "Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
+ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
"Topic :: Internet :: WWW/HTTP",
]
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/testing/runtests.py
new/django-jinja-2.6.0/testing/runtests.py
--- old/django-jinja-2.4.1/testing/runtests.py 2017-11-24 11:51:14.000000000
+0100
+++ new/django-jinja-2.6.0/testing/runtests.py 2020-02-01 04:59:29.000000000
+0100
@@ -1,6 +1,4 @@
#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
import os, sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/testing/testapp/migrations/0001_initial.py
new/django-jinja-2.6.0/testing/testapp/migrations/0001_initial.py
--- old/django-jinja-2.4.1/testing/testapp/migrations/0001_initial.py
2017-11-24 11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/testing/testapp/migrations/0001_initial.py
2020-02-01 04:59:29.000000000 +0100
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import models, migrations
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/testing/testapp/migrations/0002_testmodel_date.py
new/django-jinja-2.6.0/testing/testapp/migrations/0002_testmodel_date.py
--- old/django-jinja-2.4.1/testing/testapp/migrations/0002_testmodel_date.py
2017-11-24 11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/testing/testapp/migrations/0002_testmodel_date.py
2020-02-01 04:59:29.000000000 +0100
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import models, migrations
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/testing/testapp/models.py
new/django-jinja-2.6.0/testing/testapp/models.py
--- old/django-jinja-2.4.1/testing/testapp/models.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/testing/testapp/models.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
from django.db.models import Model, DateTimeField
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-jinja-2.4.1/testing/testapp/templates/streaming_test.jinja
new/django-jinja-2.6.0/testing/testapp/templates/streaming_test.jinja
--- old/django-jinja-2.4.1/testing/testapp/templates/streaming_test.jinja
1970-01-01 01:00:00.000000000 +0100
+++ new/django-jinja-2.6.0/testing/testapp/templates/streaming_test.jinja
2020-02-01 04:59:29.000000000 +0100
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <title>Streaming test</title>
+ </head>
+ <body>
+ <p>Streaming to the World from {{ name }}</p>
+ </body>
+</html>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/testing/testapp/tests.py
new/django-jinja-2.6.0/testing/testapp/tests.py
--- old/django-jinja-2.4.1/testing/testapp/tests.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/testing/testapp/tests.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,12 +1,4 @@
-# -*- coding: utf-8 -*-
-
-from __future__ import print_function
-from __future__ import unicode_literals
-
-import os
import datetime
-import sys
-import unittest
try:
import unittest.mock as mock
@@ -16,25 +8,23 @@
import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
-from django.core.urlresolvers import NoReverseMatch
-from django.core.urlresolvers import reverse
+from django.urls import NoReverseMatch
+from django.urls import reverse
from django.middleware import csrf
-from django.http import HttpResponse
from django.shortcuts import render
from django.template import RequestContext
from django.template import engines
from django.template.loader import get_template
from django.test import TestCase
-from django.test import signals
from django.test import override_settings
from django.test.client import RequestFactory
from django_jinja.base import get_match_extension
from django_jinja.base import match_template
-from django_jinja.backend import Template
from django_jinja.views.generic.base import Jinja2TemplateResponseMixin
from .forms import TestForm
from .models import TestModel
+from .views import StreamingTestView
class RenderTemplatesTests(TestCase):
@@ -50,16 +40,18 @@
("{{ num|floatformat }}", {'num': 34.23234}, '34.2'),
("{{ num|floatformat(3) }}", {'num': 34.23234}, '34.232'),
("{{ 'hola'|capfirst }}", {}, "Hola"),
- ("{{ 'hola mundo'|truncatechars(5) }}", {}, "ho..."),
- ("{{ 'hola mundo'|truncatechars_html(5) }}", {}, "ho..."),
- ("{{ 'hola mundo'|truncatewords(1) }}", {}, "hola ..."),
- ("{{ 'hola mundo'|truncatewords_html(1) }}", {}, "hola ..."),
+ # The list of Django 1.11 truncator / Django 2.2 truncator result.
+ ("{{ 'hola mundo'|truncatechars(5) }}", {}, ["ho...", "hola…"]),
+ ("{{ 'hola mundo'|truncatechars_html(5) }}", {}, ["ho...",
"hola…"]),
+ ("{{ 'hola mundo'|truncatewords(1) }}", {}, ["hola ...", "hola
…"]),
+ ("{{ 'hola mundo'|truncatewords_html(1) }}", {}, ["hola ...",
"hola …"]),
("{{ 'hola mundo'|wordwrap(1) }}", {}, "hola\nmundo"),
("{{ 'hola mundo'|title }}", {}, "Hola Mundo"),
("{{ 'hola mundo'|slugify }}", {}, "hola-mundo"),
("{{ 'hello'|ljust(10) }}", {}, "hello "),
("{{ 'hello'|rjust(10) }}", {}, " hello"),
- ("{{ 'hello\nworld'|linebreaksbr }}", {}, "hello<br />world"),
+ # Django 2.2 does not close br tag.
+ ("{{ 'hello\nworld'|linebreaksbr }}", {}, ["hello<br />world",
"hello<br>world"]),
("{{ '<div>hello</div>'|striptags }}", {}, "hello"),
("{{ list|join(',') }}", {'list':['a','b']}, 'a,b'),
("{{ 3|add(2) }}", {}, "5"),
@@ -73,7 +65,10 @@
print("- Testing: ", template_str, "with:", kwargs)
template = self.env.from_string(template_str)
_result = template.render(kwargs)
- self.assertEqual(_result, result)
+ if isinstance(result, str):
+ self.assertEqual(_result, result)
+ else:
+ self.assertTrue(_result in result)
def test_string_interpolation(self):
template = self.env.from_string("{{ 'Hello %s!' % name }}")
@@ -130,7 +125,8 @@
result = template.render({"form": form})
self.assertIn('maxlength="2"', result)
- self.assertIn("/>", result)
+ # Django 2.2 does not use "/>" for input html.
+ self.assertIn("<input ", result)
def test_autoscape_with_form_field(self):
form = TestForm()
@@ -138,7 +134,8 @@
result = template.render({"form": form})
self.assertIn('maxlength="2"', result)
- self.assertIn("/>", result)
+ # Django 2.2 does not use "/>" for input html.
+ self.assertIn("<input ", result)
def test_autoscape_with_form_errors(self):
form = TestForm({"name": "foo"})
@@ -172,7 +169,10 @@
def test_autoescape_03(self):
template = self.env.from_string("{{ foo|linebreaksbr }}")
result = template.render({"foo": "<script>alert(1)</script>\nfoo"})
- self.assertEqual(result, "<script>alert(1)</script><br
/>foo")
+ self.assertTrue(result in [
+ "<script>alert(1)</script><br />foo", # Django 1.11
+ "<script>alert(1)</script><br>foo", # Django 2.2
+ ])
def test_debug_var_when_render_shortcut_is_used(self):
prev_debug_value = settings.DEBUG
@@ -184,6 +184,21 @@
settings.DEBUG = prev_debug_value
+ def test_debug_tag(self):
+ """Test for {% debug %}"""
+ tmpl = self.env.from_string('''Hello{% debug %}Bye''')
+ out = tmpl.render()
+ out = out.replace(''', "'").replace('<', '<').replace('>',
'>')
+ #
+ # Check that some of the built-in items exist in the debug output...
+ #
+ assert "'context'" in out
+ assert "'cycler'" in out
+ assert "'filters'" in out
+ assert "'abs'" in out
+ assert "'tests'" in out
+ assert "'!='" in out
+
def test_csrf_01(self):
template_content = "{% csrf_token %}"
@@ -301,6 +316,20 @@
self.assertEqual(response.context["name"], "Jinja2")
self.assertTemplateUsed(response, 'hello_world.jinja')
+ def test_streaming_response(self):
+ template = "streaming_test.jinja"
+ context = {"view": StreamingTestView, "name": "Streaming Jinja2"}
+ response = self.client.get(reverse('streaming-test'))
+ self.assertEqual(response.context["name"], context["name"])
+ self.assertEqual(response.context["view"], context["view"])
+ self.assertTemplateUsed(response, template)
+ template = get_template(template)
+ self.assertEqual(
+ b''.join(response.streaming_content),
+ template.render(context).encode()
+ )
+
+
class DjangoPipelineTestTest(TestCase):
def setUp(self):
self.env = engines["jinja2"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/testing/testapp/urls.py
new/django-jinja-2.6.0/testing/testapp/urls.py
--- old/django-jinja-2.4.1/testing/testapp/urls.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/testing/testapp/urls.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,9 +1,8 @@
-# -*- coding: utf-8 -*-
-
from django.conf.urls import include, url
from django_jinja import views
from .views import BasicTestView
+from .views import StreamingTestView
from .views import PipelineTestView
from .views import CreateTestView, DeleteTestView, DetailTestView,
UpdateTestView
from .views import ListTestView
@@ -16,6 +15,7 @@
url(r"^test/404$", views.PageNotFound.as_view(), name="page-404"),
url(r"^test/403$", views.PermissionDenied.as_view(), name="page-403"),
url(r"^test/500$", views.ServerError.as_view(), name="page-500"),
+ url(r"^test-streaming/$", StreamingTestView.as_view(),
name='streaming-test'),
url(r"^testmodel/$", ListTestView.as_view()),
url(r"^testmodel/create$", CreateTestView.as_view()),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/testing/testapp/views.py
new/django-jinja-2.6.0/testing/testapp/views.py
--- old/django-jinja-2.4.1/testing/testapp/views.py 2017-11-24
11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/testing/testapp/views.py 2020-02-01
04:59:29.000000000 +0100
@@ -1,8 +1,7 @@
-# -*- coding: utf-8 -*-
-
from django.views.generic import View
-from django.http import HttpResponse
-from django.shortcuts import render_to_response
+from django.http import HttpResponse, StreamingHttpResponse
+from django.shortcuts import render
+from django.template import loader
from django.template.loader import render_to_string
from django_jinja.views.generic.detail import DetailView
@@ -22,11 +21,11 @@
class PipelineTestView(View):
def get(self, request, data=None):
- return render_to_response("pipeline_test.jinja", request=request)
+ return render(request, "pipeline_test.jinja")
class ContextManipulationTestView(View):
def get(self, request):
- return render(request, "hello_world.jinja", {"name": "Jinja2"},
request=request)
+ return render(request, "hello_world.jinja", {"name": "Jinja2"})
# ==== generic.detail ====
class DetailTestView(DetailView):
@@ -80,3 +79,9 @@
model = TestModel
date_field = 'date'
template_name_suffix = '_date_detail'
+
+class StreamingTestView(View):
+ def get(self, request, *args, **kwargs):
+ context = {"name": "Streaming Jinja2", "view": type(self)}
+ template = loader.get_template('streaming_test.jinja')
+ return StreamingHttpResponse(template.stream(context, request),
content_type='text/html')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-jinja-2.4.1/tox.ini
new/django-jinja-2.6.0/tox.ini
--- old/django-jinja-2.4.1/tox.ini 2017-11-24 11:51:14.000000000 +0100
+++ new/django-jinja-2.6.0/tox.ini 2020-02-01 04:59:29.000000000 +0100
@@ -1,9 +1,16 @@
[tox]
-envlist = py27,py34,py35
+envlist =
+ py{35,36}-django111
+ py{35,36,37,38}-django22
+ py{36,37,38}-django30
+
[testenv]
changedir=testing
commands=python runtests.py
deps=
+ django111: Django>=1.11,<2.0
+ django22: Django>=2.2,<3.0
+ django30: Django>=3.0,<3.1
jinja2
django-pipeline<1.6
pytz