summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorMoritz <moritz@tibidat.com>2014-05-16 17:52:59 +0200
committerErik Romijn <eromijn@solidlinks.nl>2014-05-16 18:29:25 +0200
commit20215f4cae4f69f2bcbc4bbdbcd84651bee64634 (patch)
treed104645c569b19733377afd560b25e8e1b114cac /docs/ref
parent1a3371d1e41dba8d49246e6fab1bdf5b2b236d1c (diff)
[1.6.x] Fixed #22167 -- Improved documentation on context processors
Backport of e7ffba8f78849fbf60b98fb8d67ef4577b585e3b from master.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/templates/api.txt14
1 files changed, 9 insertions, 5 deletions
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt
index 60f2dce920..1c3dd4ed39 100644
--- a/docs/ref/templates/api.txt
+++ b/docs/ref/templates/api.txt
@@ -393,11 +393,11 @@ below.
.. admonition:: When context processors are applied
- When you use ``RequestContext``, the variables you supply directly
- are added first, followed any variables supplied by context
- processors. This means that a context processor may overwrite a
- variable you've supplied, so take care to avoid variable names
- which overlap with those supplied by your context processors.
+ Context processors are applied *after* the context itself is processed.
+ This means that a context processor may overwrite variables you've
+ supplied to your ``Context`` or ``RequestContext``, so take care
+ to avoid variable names that overlap with those supplied by your
+ context processors.
Also, you can give ``RequestContext`` a list of additional processors, using the
optional, third positional argument, ``processors``. In this example, the
@@ -439,6 +439,10 @@ optional, third positional argument, ``processors``. In this example, the
the same as a call to :func:`~django.shortcuts.render_to_response()` with a
context_instance argument that forces the use of a ``RequestContext``.
+ Note that the contents of a supplied dictionary (``my_data_dictionary``
+ in this example) will take precedence over any variables supplied by
+ context processors or the ``RequestContext``.
+
Here's what each of the default processors does:
django.contrib.auth.context_processors.auth