Ticket #6502: 6502.diff

File 6502.diff, 1.3 KB (added by Chris Beaven, 17 years ago)
  • docs/shortcuts.txt

     
    2222Optional arguments
    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.
    2929
     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))
     40
    3041``mimetype``
    3142    **New in Django development version:** The MIME type to use for the
    3243    resulting document. Defaults to the value of the ``DEFAULT_CONTENT_TYPE``
    3344    setting.
    3445
     46.. _`context processors`: ../templates_python/#subclassing-context-requestcontext
     47
    3548Example
    3649-------
    3750
Back to Top