Update templates and related config/logic for Django 1.6+ compatibility.
Review Request #8687 — Created Jan. 31, 2017 and submitted
This makes some changes to our configuration, templates, template tags,
and imports to be compatible with Django 1.6 and higher. Some of the
imports and code we were using was already deprecated in Django 1.6, but
worked anyway.Template tags using
@simple_tag
no longer return content the same way.
They're set to conditionally escape, which impacts some of our tags. A
couple now explicitly usemark_safe()
, and another (which is used to
build query strings) that used to not escape now escapes (since the
ampersands should technically be escaped for URLs in HTML).Template configuration has changed. All new template-related
configuration lives in aTEMPLATES
setting, which encompasses the
directories, context processors, and loaders. Our test suite's settings
now retains compatibility with the old style and the new style by
setting the old variables and using it to build the new one.
Unit tests pass on Django 1.6, 1.7, 1.8, 1.9, and 1.10.
Verified that the template and template tag changes producted the
correct output in real use.
Description | From | Last Updated |
---|---|---|
To make this clearer re: the documentation on loaders, we should use a list here instead of a tuple. |
david |
- Change Summary:
-
Switched from tuples to lists in settings.
- Commit:
-
219d5fd58e1b8370c941811a5f9c704a7ec72f616f34c1580a2b0e0bab1cc0318a5ad46bdd664c2b
-
Tool: PEP8 Style Checker Processed Files: djblets/util/templatetags/djblets_email.py djblets/util/templatetags/tests.py djblets/template/loaders/namespaced_app_dirs.py djblets/util/templatetags/djblets_utils.py tests/settings.py Ignored Files: djblets/datagrid/templates/datagrid/listview.html Tool: Pyflakes Processed Files: djblets/util/templatetags/djblets_email.py djblets/util/templatetags/tests.py djblets/template/loaders/namespaced_app_dirs.py djblets/util/templatetags/djblets_utils.py tests/settings.py Ignored Files: djblets/datagrid/templates/datagrid/listview.html