소스 검색

Fixed #25804 -- Documented additions to Jinja2 context.

Moritz Sichert 9 년 전
부모
커밋
6aef986cdb
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      docs/topics/templates.txt

+ 7 - 4
docs/topics/templates.txt

@@ -401,10 +401,13 @@ adds defaults that differ from Jinja2's for a few options:
 * ``'auto_reload'``: ``settings.DEBUG``
 * ``'undefined'``: ``DebugUndefined if settings.DEBUG else Undefined``
 
-The default configuration is purposefully kept to a minimum. The ``Jinja2``
-backend doesn't create a Django-flavored environment. It doesn't know about
-Django context processors, filters, and tags. In order to use Django-specific
-APIs, you must configure them into the environment.
+The default configuration is purposefully kept to a minimum. If a template is
+rendered with a request (e.g. when using :py:func:`~django.shortcuts.render`),
+the ``Jinja2`` backend adds the globals ``request``, ``csrf_input``, and
+``csrf_token`` to the context. Apart from that, this backend doesn't create a
+Django-flavored environment. It doesn't know about Django context processors,
+filters, and tags. In order to use Django-specific APIs, you must configure
+them into the environment.
 
 For example, you can create ``myproject/jinja2.py`` with this content::