summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-11-28 23:50:34 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-12-28 16:23:02 +0100
commit90805b240fdb1a1570c414f7d55fa1b0b77e1f24 (patch)
tree4f3fcccb3b8709c54eb2c7a1e00967694e25390f /docs/ref
parentf9a6ebf6f5c8e1723db680bf6d462a9df8889d7f (diff)
Supported multiple template engines in render_to_string.
Adjusted its API through a deprecation path according to the DEP.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/templates/api.txt17
1 files changed, 13 insertions, 4 deletions
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt
index c86b7873ae..f184544838 100644
--- a/docs/ref/templates/api.txt
+++ b/docs/ref/templates/api.txt
@@ -890,7 +890,7 @@ When :setting:`TEMPLATE_DEBUG` is ``True`` template objects will have an
The ``render_to_string`` shortcut
===================================
-.. function:: loader.render_to_string(template_name, dictionary=None, context_instance=None)
+.. function:: loader.render_to_string(template_name, context=None, context_instance=None)
To cut down on the repetitive nature of loading and rendering
templates, Django provides a shortcut function which largely
@@ -906,16 +906,25 @@ The ``render_to_string`` shortcut takes one required argument --
and render (or a list of template names, in which case Django will use
the first template in the list that exists) -- and two optional arguments:
-dictionary
+``context``
A dictionary to be used as variables and values for the
- template's context. This can also be passed as the second
+ template's context. This should be passed as the second
positional argument.
-context_instance
+ .. versionchanged:: 1.8
+
+ The ``context`` argument used to be called ``dictionary``. That name
+ is deprecated in Django 1.8 and will be removed in Django 2.0.
+
+``context_instance``
An instance of :class:`~django.template.Context` or a subclass (e.g., an
instance of :class:`~django.template.RequestContext`) to use as the
template's context. This can also be passed as the third positional argument.
+ .. deprecated:: 1.8
+
+ The ``context_instance`` argument is deprecated. Simply use ``context``.
+
See also the :func:`~django.shortcuts.render_to_response()` shortcut, which
calls ``render_to_string`` and feeds the result into an :class:`~django.http.HttpResponse`
suitable for returning directly from a view.