#22167 closed Cleanup/optimization (fixed)
docs about order of template context processors unclear
Reported by: | anonymous | Owned by: | Sasha Romijn |
---|---|---|---|
Component: | Documentation | Version: | 1.5 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If I do:
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?
Change History (9)
comment:1 by , 11 years ago
Component: | Template system → Documentation |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 10 years ago
Owner: | changed from | to
---|
comment:5 by , 10 years ago
Owner: | changed from | to
---|
comment:6 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Doing this during the DjangoConEu 2014 Sprints.