Changeset 7052
- Timestamp:
- 01/31/08 16:49:14 (10 months ago)
- Files:
-
- django/trunk/docs/shortcuts.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/shortcuts.txt
r7006 r7052 23 23 ------------------ 24 24 25 `` context``25 ``dictionary`` 26 26 A dictionary of values to add to the template context. By default, this 27 27 is an empty dictionary. If a value in the dictionary is callable, the 28 28 view will call it just before rendering the template. 29 30 ``context_instance`` 31 The context instance to render the template with. By default, the template 32 will be rendered with a ``Context`` instance (filled with values from 33 ``dictionary``). If you need to use `context processors`_, you will want to 34 render the template with a ``RequestContext`` instance instead. Your code 35 might look something like this:: 36 37 return render_to_response('my_template.html', 38 my_data_dictionary, 39 context_instance=RequestContext(request)) 29 40 30 41 ``mimetype`` … … 32 43 resulting document. Defaults to the value of the ``DEFAULT_CONTENT_TYPE`` 33 44 setting. 45 46 .. _`context processors`: ../templates_python/#subclassing-context-requestcontext 34 47 35 48 Example
