Ticket #13841: 13841-docs.diff

File 13841-docs.diff, 1.1 KB (added by simon29, 5 years ago)

Updated docs.

  • ref/templates/api.txt

     
    516516~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    517517
    518518A context processor has a very simple interface: It's just a Python function
    519 that takes one argument, an :class:`~django.http.HttpRequest` object, and
    520 returns a dictionary that gets added to the template context. Each context
    521 processor *must* return a dictionary.
     519that takes at least one argument, an :class:`~django.http.HttpRequest` object.
    522520
     521.. versionadded:: 1.2
     522   The optional keyword argument ``context`` is now supported, which allows
     523   access to the current :class:`~django.template.Context` object.
     524
     525The function returns a dictionary that gets added to the template context.
     526Each context processor *must* return a dictionary.
     527
    523528Custom context processors can live anywhere in your code base. All Django cares
    524529about is that your custom context processors are pointed-to by your
    525530:setting:`TEMPLATE_CONTEXT_PROCESSORS` setting.
Back to Top