Update templates and related config/logic for Django 1.6+ compatibility.

Review Request #8687 — Created Jan. 31, 2017 and submitted

Information

Djblets
release-0.10.x
6f34c15...

Reviewers

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 use mark_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 a TEMPLATES 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.

daviddavid
reviewbot
  1. 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
    
    
    
    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
    
    
  2. 
      
david
  1. 
      
  2. tests/settings.py (Diff revision 1)
     
     
     
     
     

    To make this clearer re: the documentation on loaders, we should use a list here instead of a tuple.

  3. 
      
brennie
  1. Ship It!
  2. 
      
chipx86
reviewbot
  1. 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
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.10.x (72c8f05)
Loading...