diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/templates/api.txt | 14 | ||||
| -rw-r--r-- | docs/releases/1.10.txt | 4 | ||||
| -rw-r--r-- | docs/topics/templates.txt | 13 |
3 files changed, 29 insertions, 2 deletions
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt index 570ffbc9d6..aaa08cc70b 100644 --- a/docs/ref/templates/api.txt +++ b/docs/ref/templates/api.txt @@ -48,7 +48,7 @@ probably isn't the documentation you're looking for. An instance of the of that backend and any attribute defaults mentioned below are overridden by what's passed by :class:`~django.template.backends.django.DjangoTemplates`. -.. class:: Engine(dirs=None, app_dirs=False, context_processors=None, debug=False, loaders=None, string_if_invalid='', file_charset='utf-8', libraries=None, builtins=None) +.. class:: Engine(dirs=None, app_dirs=False, context_processors=None, debug=False, loaders=None, string_if_invalid='', file_charset='utf-8', libraries=None, builtins=None, autoescape=True) When instantiating an ``Engine`` all arguments must be passed as keyword arguments: @@ -63,6 +63,18 @@ what's passed by :class:`~django.template.backends.django.DjangoTemplates`. It defaults to ``False``. + * ``autoescape`` controls whether HTML autoescaping is enabled. + + It defaults to ``True``. + + .. warning:: + + Only set it to ``False`` if you're rendering non-HTML templates! + + .. versionadded:: 1.10 + + The ``autoescape`` option was added. + * ``context_processors`` is a list of dotted Python paths to callables that are used to populate the context when a template is rendered with a request. These callables take a request object as their argument and diff --git a/docs/releases/1.10.txt b/docs/releases/1.10.txt index 1f3857ab28..6dbe0362b9 100644 --- a/docs/releases/1.10.txt +++ b/docs/releases/1.10.txt @@ -204,7 +204,9 @@ Signals Templates ^^^^^^^^^ -* ... +* Added the ``autoescape`` option to the + :class:`~django.template.backends.django.DjangoTemplates` backend and the + :class:`~django.template.Engine` class. Tests ^^^^^ diff --git a/docs/topics/templates.txt b/docs/topics/templates.txt index f0abccc835..4834e9eb06 100644 --- a/docs/topics/templates.txt +++ b/docs/topics/templates.txt @@ -295,6 +295,19 @@ applications. This generic name was kept for backwards-compatibility. ``DjangoTemplates`` engines accept the following :setting:`OPTIONS <TEMPLATES-OPTIONS>`: +* ``'autoescape'``: a boolean that controls whether HTML autoescaping is + enabled. + + It defaults to ``True``. + + .. warning:: + + Only set it to ``False`` if you're rendering non-HTML templates! + + .. versionadded:: 1.10 + + The ``autoescape`` option was added. + * ``'context_processors'``: a list of dotted Python paths to callables that are used to populate the context when a template is rendered with a request. These callables take a request object as their argument and return a |
