Opened 12 years ago

Closed 11 years ago

#2837 closed enhancement (worksforme)

missing context_instance explanation in the template documentation

Reported by: thomas.rabaix@… Owned by: Jacob
Component: Documentation Version: 0.95
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The documentation about the template engine does not explain how to use custom context processor in a custom view

@@ -301,6 +301,15 @@
 .. _HttpRequest object:
+Note : in your custom views, you need to specify the correct context instance in order to access to the variable set
+in your processor. 
+   from django import template
+   def demo(request):
+       values = {'Invoice': '20061254'}
+       return render_to_response('demo/demo.html', values, context_instance=template.RequestContext(request))

Change History (4)

comment:1 Changed 12 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [3911]) Fixed #2837 -- Documented the context_instance parameter to

comment:2 Changed 12 years ago by Yasushi Masuda <ymasuda@…>

Resolution: fixed
Status: closedreopened

It would be better to mark the note as docutils .. Note:: (or .. admonition:: with a title) directive.

comment:3 Changed 12 years ago by Yasushi Masuda <ymasuda@…>

In addition, please fix 'my_template'html' in sample code, it should be 'my_template.html'.

comment:4 Changed 11 years ago by Simon G. <dev@…>

Resolution: worksforme
Status: reopenedclosed
Note: See TracTickets for help on using tickets.
Back to Top