mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-22 14:01:53 +00:00
Use Django 1.8 TEMPLATES setting in settings doc
Also, the ``request`` context processor is now in the defaults
This commit is contained in:
parent
a6c2100362
commit
9d3e068b0c
1 changed files with 14 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue