Ticket #9169: ticket-9169-v1.diff

File ticket-9169-v1.diff, 1020 bytes (added by jeremyb, 7 years ago)


  • docs/ref/templates/api.txt

    287287Django comes with a special ``Context`` class,
    288288``django.template.RequestContext``, that acts slightly differently than the
    289289normal ``django.template.Context``. The first difference is that it takes an
    290290:class:`~django.http.HttpRequest` as its first argument. For example::
    292292    c = RequestContext(request, {
    293293        'foo': 'bar',
    294     }
     294    })
    296296The second difference is that it automatically populates the context with a few
    297297variables, according to your :setting:`TEMPLATE_CONTEXT_PROCESSORS` setting`.
    299299The :setting:`TEMPLATE_CONTEXT_PROCESSORS` setting is a tuple of callables --
    300300called **context processors** -- that take a request object as their argument
    301301and return a dictionary of items to be merged into the context. By default,
    302302:setting:`TEMPLATE_CONTEXT_PROCESSORS` is set to::
Back to Top