{{{
return render_to_response('my_template.html',
my_data_dictionary,
context_instance=RequestContext(request))
}}}
then my_data_dictionary will override anything added by the context
processors.
The docs state:
"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"
Which seems to relate to this situation:
{{{
return render_to_response('my_template.html',
context_instance=RequestContext(request,
my_data_dictionary))
}}}
This seems inconsistent, could there be an extra note added to clarify
what happens when my_data_dictionary is passed to render_to_response
instead of RequestContext?
--
Ticket URL: <https://code.djangoproject.com/ticket/22167>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_docs: => 0
* needs_better_patch: => 0
* component: Template system => Documentation
* needs_tests: => 0
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/22167#comment:1>
* owner: nobody => anonymous
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/22167#comment:2>
* owner: anonymous => tibidat
Comment:
Doing this during the DjangoConEu 2014 Sprints.
--
Ticket URL: <https://code.djangoproject.com/ticket/22167#comment:3>
Comment (by tibidat):
Pull request added: https://github.com/django/django/pull/2665
--
Ticket URL: <https://code.djangoproject.com/ticket/22167#comment:4>
* owner: tibidat => erikr
--
Ticket URL: <https://code.djangoproject.com/ticket/22167#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"e7ffba8f78849fbf60b98fb8d67ef4577b585e3b"]:
{{{
#!CommitTicketReference repository=""
revision="e7ffba8f78849fbf60b98fb8d67ef4577b585e3b"
Fixed #22167 -- Improved documentation on context processors
Clarified the explanation on the order in which user provided variables
to render_to_response, RequestContext and context processors are
loaded.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22167#comment:6>
Comment (by Erik Romijn <eromijn@…>):
In [changeset:"bd45139d4e17304229da5464c907c614e64278d1"]:
{{{
#!CommitTicketReference repository=""
revision="bd45139d4e17304229da5464c907c614e64278d1"
[1.7.x] Fixed #22167 -- Improved documentation on context processors
Backport of e7ffba8f78849fbf60b98fb8d67ef4577b585e3b from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22167#comment:7>
Comment (by Erik Romijn <eromijn@…>):
In [changeset:"20215f4cae4f69f2bcbc4bbdbcd84651bee64634"]:
{{{
#!CommitTicketReference repository=""
revision="20215f4cae4f69f2bcbc4bbdbcd84651bee64634"
[1.6.x] Fixed #22167 -- Improved documentation on context processors
Backport of e7ffba8f78849fbf60b98fb8d67ef4577b585e3b from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22167#comment:8>
Comment (by Erik Romijn <eromijn@…>):
In [changeset:"220c09e97acb8ca4267a0b754256e522e008c2d8"]:
{{{
#!CommitTicketReference repository=""
revision="220c09e97acb8ca4267a0b754256e522e008c2d8"
[1.5.x] Fixed #22167 -- Improved documentation on context processors
Backport of e7ffba8f78849fbf60b98fb8d67ef4577b585e3b from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22167#comment:9>