summaryrefslogtreecommitdiff
path: root/docs/topics/http
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2015-01-26 21:57:10 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2015-02-03 08:32:14 +0100
commitf87457a4604efc862381020b47f4e6fe8272ac0b (patch)
tree66681e1ff62fcf8c577570b1c9242d5d9a97a346 /docs/topics/http
parent3af1e7860e0160bd126bdafebf8511b1ea365af9 (diff)
[1.8.x] Fixed #24168 -- Allowed selecting a template engine in a few APIs.
Specifically in rendering shortcuts, template responses, and class-based views that return template responses. Also added a test for render_to_response(status=...) which was missing from fdbfc980. Thanks Tim and Carl for the review. Backport of 2133f31 from master. Conflicts: docs/topics/http/shortcuts.txt tests/generic_views/test_base.py
Diffstat (limited to 'docs/topics/http')
-rw-r--r--docs/topics/http/shortcuts.txt18
1 files changed, 15 insertions, 3 deletions
diff --git a/docs/topics/http/shortcuts.txt b/docs/topics/http/shortcuts.txt
index f015786838..780176c824 100644
--- a/docs/topics/http/shortcuts.txt
+++ b/docs/topics/http/shortcuts.txt
@@ -15,7 +15,7 @@ introduce controlled coupling for convenience's sake.
``render``
==========
-.. function:: render(request, template_name[, context][, context_instance][, content_type][, status][, current_app][, dirs])
+.. function:: render(request, template_name[, context][, context_instance][, content_type][, status][, current_app][, dirs][, using])
Combines a given template with a given context dictionary and returns an
:class:`~django.http.HttpResponse` object with that rendered text.
@@ -77,6 +77,14 @@ Optional arguments
The ``current_app`` argument is deprecated. Instead you should set
``request.current_app``.
+``using``
+ The :setting:`NAME <TEMPLATES-NAME>` of a template engine to use for
+ loading the template.
+
+.. versionchanged:: 1.8
+
+ The ``using`` parameter was added.
+
.. versionchanged:: 1.7
The ``dirs`` parameter was added.
@@ -113,7 +121,7 @@ This example is equivalent to::
``render_to_response``
======================
-.. function:: render_to_response(template_name[, context][, context_instance][, content_type][, status][, dirs])
+.. function:: render_to_response(template_name[, context][, context_instance][, content_type][, status][, dirs][, using])
Renders a given template with a given context dictionary and returns an
:class:`~django.http.HttpResponse` object with that rendered text.
@@ -163,9 +171,13 @@ Optional arguments
``status``
The status code for the response. Defaults to ``200``.
+``using``
+ The :setting:`NAME <TEMPLATES-NAME>` of a template engine to use for
+ loading the template.
+
.. versionchanged:: 1.8
- The ``status`` parameter was added.
+ The ``status`` and ``using`` parameters were added.
.. versionchanged:: 1.7