Use Django 1.8 TEMPLATES setting in settings doc

Also, the ``request`` context processor is now in the defaults
pull/2043/head
Karl Hobley 2015-12-15 17:16:01 +00:00 zatwierdzone przez Matt Westcott
rodzic a6c2100362
commit 9d3e068b0c
1 zmienionych plików z 14 dodań i 5 usunięć

Wyświetl plik

@ -93,16 +93,25 @@ If access to a setting is required in the code, the :func:`~wagtail.contrib.sett
Using in templates
------------------
Add the ``request`` and ``settings`` context processors to your settings:
Add the ``settings`` context processor to your settings:
.. code-block:: python
from django.conf import global_settings
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + [
'django.core.context_processors.request',
'wagtail.contrib.settings.context_processors.settings',
TEMPLATES = [
{
...
'OPTIONS': {
'context_processors': [
...
'wagtail.contrib.settings.context_processors.settings',
]
}
}
]
Then access the settings through ``{{ settings }}``:
.. code-block:: html+django