Ticket #9169: ticket-9169-v1.diff
File ticket-9169-v1.diff, 1020 bytes (added by , 16 years ago) |
---|
-
docs/ref/templates/api.txt
286 286 287 287 Django comes with a special ``Context`` class, 288 288 ``django.template.RequestContext``, that acts slightly differently than the 289 289 normal ``django.template.Context``. The first difference is that it takes an 290 290 :class:`~django.http.HttpRequest` as its first argument. For example:: 291 291 292 292 c = RequestContext(request, { 293 293 'foo': 'bar', 294 } 294 }) 295 295 296 296 The second difference is that it automatically populates the context with a few 297 297 variables, according to your :setting:`TEMPLATE_CONTEXT_PROCESSORS` setting`. 298 298 299 299 The :setting:`TEMPLATE_CONTEXT_PROCESSORS` setting is a tuple of callables -- 300 300 called **context processors** -- that take a request object as their argument 301 301 and return a dictionary of items to be merged into the context. By default, 302 302 :setting:`TEMPLATE_CONTEXT_PROCESSORS` is set to::