mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
Update information on template context processors
TEMPLATE_CONTEXT_PROCESSORS is deprecated in Django 1.8. This updates the documentation to match.
This commit is contained in:
parent
d33df08592
commit
0bd88e2d49
1 changed files with 3 additions and 1 deletions
|
|
@ -209,7 +209,7 @@ pass the object to the template context:
|
|||
def myview(request):
|
||||
return render(request, 'my_template.html', {'config': config})
|
||||
|
||||
Or you can use the included config context processor.:
|
||||
Or you can use the included config context processor. For Django pre-1.8, this looks like this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
|
@ -218,6 +218,8 @@ Or you can use the included config context processor.:
|
|||
'constance.context_processors.config',
|
||||
)
|
||||
|
||||
For Django 1.8 and above, insert ``'constance.context_processors.config'`` at the top of your ``TEMPLATES['OPTIONS']['context_processors']`` list. See (See the `Django documentation<https://docs.djangoproject.com/en/1.11/ref/templates/upgrading/#the-templates-settings>`_ for details.
|
||||
|
||||
This will add the config instance to the context of any template
|
||||
rendered with a ``RequestContext``.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue