Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #20294 -- Documented context processors in TemplateResponseMixin.

  • Loading branch information...
1 parent 8fd44b2 commit 0b0741602b18928a418ba4661dc24b880daa5253 @zsiciarz zsiciarz committed with apollo13
Showing with 11 additions and 0 deletions.
  1. +11 −0 docs/ref/class-based-views/mixins-simple.txt
11 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

0 comments on commit 0b07416

Please sign in to comment.
Something went wrong with that request. Please try again.