From 0bd88e2d49366d5ec948fa6a76e5ab02e24d60f1 Mon Sep 17 00:00:00 2001 From: Josh Kelley Date: Tue, 17 Oct 2017 21:20:20 -0400 Subject: [PATCH] Update information on template context processors TEMPLATE_CONTEXT_PROCESSORS is deprecated in Django 1.8. This updates the documentation to match. --- docs/index.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 15057ac..39815c0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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`_ for details. + This will add the config instance to the context of any template rendered with a ``RequestContext``.