summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorZbigniew Siciarz <antyqjon@gmail.com>2013-05-18 12:32:48 +0200
committerFlorian Apolloner <florian@apolloner.eu>2013-05-18 12:45:40 +0200
commit0b0741602b18928a418ba4661dc24b880daa5253 (patch)
treedf548b3331eb30ab183ea70b41856467ca3dd1e9 /docs
parent8fd44b2551b9cca765b216a31306f9c6935f1492 (diff)
Fixed #20294 -- Documented context processors in TemplateResponseMixin.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/class-based-views/mixins-simple.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/ref/class-based-views/mixins-simple.txt b/docs/ref/class-based-views/mixins-simple.txt
index 6796675529..377c85cc3b 100644
--- a/docs/ref/class-based-views/mixins-simple.txt
+++ b/docs/ref/class-based-views/mixins-simple.txt
@@ -60,6 +60,17 @@ TemplateResponseMixin
altered later (e.g. in
:ref:`template response middleware <template-response-middleware>`).
+ .. admonition:: Context processors
+
+ ``TemplateResponse`` uses :class:`~django.template.RequestContext`
+ which means that callables defined in
+ :setting:`TEMPLATE_CONTEXT_PROCESSORS` may overwrite template
+ variables defined in your views. For example, if you subclass
+ :class:`DetailView <django.views.generic.detail.DetailView>` and
+ set ``context_object_name`` to ``user``, the
+ ``django.contrib.auth.context_processors.auth`` context processor
+ will happily overwrite your variable with current user.
+
If you need custom template loading or custom context object
instantiation, create a ``TemplateResponse`` subclass and assign it to
``response_class``.