kopia lustrzana https://github.com/wagtail/wagtail
Use Django 1.8 TEMPLATES setting in settings doc
Also, the ``request`` context processor is now in the defaultspull/2043/head
rodzic
a6c2100362
commit
9d3e068b0c
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue