Skip to content

Commit cdd9507

Browse files
committed
Fixed #11889: Documented the fact that context processors will overwrite pre-existing context variables of the same names.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12669 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 1f56ed7 commit cdd9507

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/ref/templates/api.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,13 @@ variable to the context and a second processor adds a variable with the same
335335
name, the second will override the first. The default processors are explained
336336
below.
337337

338+
.. admonition:: When context processors are applied
339+
When you use ``RequestContext``, the variables you supply directly
340+
are added first, followed any variables supplied by context
341+
processors. This means that a context processor may overwrite a
342+
variable you've supplied, so take care to avoid variable names
343+
which overlap with those supplied by your context processors.
344+
338345
Also, you can give ``RequestContext`` a list of additional processors, using the
339346
optional, third positional argument, ``processors``. In this example, the
340347
``RequestContext`` instance gets a ``ip_address`` variable::

0 commit comments

Comments
 (0)