diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-01-26 21:57:10 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-02-03 08:29:45 +0100 |
| commit | 2133f3157eff853329bafb7fda74c3c8fb4eae42 (patch) | |
| tree | 5bb262ab847c79b3f70d8a8888e267b2816b0373 /docs/topics | |
| parent | a53541852d5601232899e54d66e623bc163c6dc2 (diff) | |
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.
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/http/shortcuts.txt | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/docs/topics/http/shortcuts.txt b/docs/topics/http/shortcuts.txt index 957f042d12..b2c5da3666 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. + .. deprecated:: 1.8 The ``dirs`` parameter was deprecated. @@ -109,7 +117,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. @@ -159,9 +167,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. .. deprecated:: 1.8 |
