Django

Code

Changeset 7052

Show
Ignore:
Timestamp:
01/31/08 16:49:14 (10 months ago)
Author:
gwilson
Message:

Fixed #6502 -- Documented context_instance argument of render_to_response, thanks SmileyChris.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/shortcuts.txt

    r7006 r7052  
    2323------------------ 
    2424 
    25 ``context`` 
     25``dictionary`` 
    2626    A dictionary of values to add to the template context. By default, this 
    2727    is an empty dictionary. If a value in the dictionary is callable, the 
    2828    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)) 
    2940 
    3041``mimetype`` 
     
    3243    resulting document. Defaults to the value of the ``DEFAULT_CONTENT_TYPE`` 
    3344    setting. 
     45 
     46.. _`context processors`: ../templates_python/#subclassing-context-requestcontext 
    3447 
    3548Example