Commit 2a20ebe6 authored by Tim Graham's avatar Tim Graham
Browse files

Removed deprecated TEMPLATE_* settings per deprecation timeline.

parent 90236966
Loading
Loading
Loading
Loading
+0 −29
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@ gettext_noop = lambda s: s
####################

DEBUG = False
TEMPLATE_DEBUG = False

# Whether the framework should propagate raw exceptions rather than catching
# them. This is useful under some testing situations and should never be used
@@ -199,34 +198,6 @@ EMAIL_TIMEOUT = None
# List of strings representing installed apps.
INSTALLED_APPS = []

# List of locations of the template source files, in search order.
TEMPLATE_DIRS = []

# List of callables that know how to import templates from various sources.
# See the comments in django/core/template/loader.py for interface
# documentation.
TEMPLATE_LOADERS = [
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
]

# List of processors used by RequestContext to populate the context.
# Each one should be a callable that takes the request object as its
# only parameter and returns a dictionary to add to the context.
TEMPLATE_CONTEXT_PROCESSORS = [
    'django.contrib.auth.context_processors.auth',
    'django.template.context_processors.debug',
    'django.template.context_processors.i18n',
    'django.template.context_processors.media',
    'django.template.context_processors.static',
    'django.template.context_processors.tz',
    # 'django.template.context_processors.request',
    'django.contrib.messages.context_processors.messages',
]

# Output to use in template system for invalid (e.g. misspelled) variables.
TEMPLATE_STRING_IF_INVALID = ''

TEMPLATES = []

# Default email address to use for various automated correspondence from
+4 −7
Original line number Diff line number Diff line
from __future__ import unicode_literals

from django.conf import global_settings, settings
from django.conf import settings

from .. import Tags, Warning, register

@@ -15,16 +15,13 @@ def check_duplicate_template_settings(app_configs, **kwargs):
            'TEMPLATE_LOADERS',
            'TEMPLATE_STRING_IF_INVALID',
        ]
        duplicates = [
            value for value in values
            if getattr(settings, value) != getattr(global_settings, value)
        ]
        if duplicates:
        defined = [value for value in values if getattr(settings, value, None)]
        if defined:
            return [Warning(
                "The standalone TEMPLATE_* settings were deprecated in Django "
                "1.8 and the TEMPLATES dictionary takes precedence. You must "
                "put the values of the following settings into your default "
                "TEMPLATES dict: %s." % ", ".join(duplicates),
                "TEMPLATES dict: %s." % ", ".join(defined),
                id='1_8.W001',
            )]
    return []
+0 −20
Original line number Diff line number Diff line
import os
import warnings
from collections import Counter, OrderedDict

from django.apps import apps
@@ -7,7 +6,6 @@ from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache
from django.utils._os import upath
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.functional import cached_property
from django.utils.module_loading import import_string

@@ -30,24 +28,6 @@ class EngineHandler(object):
        if self._templates is None:
            self._templates = settings.TEMPLATES

        if not self._templates:
            warnings.warn(
                "You haven't defined a TEMPLATES setting. You must do so "
                "before upgrading to Django 1.10. Otherwise Django will be "
                "unable to load templates.", RemovedInDjango110Warning)
            self._templates = [
                {
                    'BACKEND': 'django.template.backends.django.DjangoTemplates',
                    'DIRS': settings.TEMPLATE_DIRS,
                    'OPTIONS': {
                        'context_processors': settings.TEMPLATE_CONTEXT_PROCESSORS,
                        'debug': settings.TEMPLATE_DEBUG,
                        'loaders': settings.TEMPLATE_LOADERS,
                        'string_if_invalid': settings.TEMPLATE_STRING_IF_INVALID,
                    },
                },
            ]

        templates = OrderedDict()
        backend_names = []
        for tpl in self._templates:
+0 −5
Original line number Diff line number Diff line
@@ -84,11 +84,6 @@ def clear_routers_cache(**kwargs):
def reset_template_engines(**kwargs):
    if kwargs['setting'] in {
        'TEMPLATES',
        'TEMPLATE_DIRS',
        'TEMPLATE_CONTEXT_PROCESSORS',
        'TEMPLATE_DEBUG',
        'TEMPLATE_LOADERS',
        'TEMPLATE_STRING_IF_INVALID',
        'DEBUG',
        'FILE_CHARSET',
        'INSTALLED_APPS',
+2 −3
Original line number Diff line number Diff line
@@ -252,9 +252,8 @@ that might occur as a result of a version upgrade.
* **1_8.W001**: The standalone ``TEMPLATE_*`` settings were deprecated in
  Django 1.8 and the :setting:`TEMPLATES` dictionary takes precedence. You must
  put the values of the following settings into your defaults ``TEMPLATES``
  dict: :setting:`TEMPLATE_DIRS`, :setting:`TEMPLATE_CONTEXT_PROCESSORS`,
  :setting:`TEMPLATE_DEBUG`, :setting:`TEMPLATE_LOADERS`,
  :setting:`TEMPLATE_STRING_IF_INVALID`.
  dict: ``TEMPLATE_DIRS``, ``TEMPLATE_CONTEXT_PROCESSORS``, ``TEMPLATE_DEBUG``,
  ``TEMPLATE_LOADERS``, ``TEMPLATE_STRING_IF_INVALID``.

Admin
-----
Loading