Skip to content

Commit

Permalink
Fixed #6502 -- Documented context_instance argument of `render_to_r…
Browse files Browse the repository at this point in the history
…esponse`, thanks `SmileyChris`.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7052 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
gdub committed Jan 31, 2008
1 parent 28353a6 commit d3d5861
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/shortcuts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,29 @@ Required arguments
Optional arguments
------------------

``context``
``dictionary``
A dictionary of values to add to the template context. By default, this
is an empty dictionary. If a value in the dictionary is callable, the
view will call it just before rendering the template.

``context_instance``
The context instance to render the template with. By default, the template
will be rendered with a ``Context`` instance (filled with values from
``dictionary``). If you need to use `context processors`_, you will want to
render the template with a ``RequestContext`` instance instead. Your code
might look something like this::

return render_to_response('my_template.html',
my_data_dictionary,
context_instance=RequestContext(request))

``mimetype``
**New in Django development version:** The MIME type to use for the
resulting document. Defaults to the value of the ``DEFAULT_CONTENT_TYPE``
setting.

.. _`context processors`: ../templates_python/#subclassing-context-requestcontext

Example
-------

Expand Down

0 comments on commit d3d5861

Please sign in to comment.