From 2133f3157eff853329bafb7fda74c3c8fb4eae42 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Mon, 26 Jan 2015 21:57:10 +0100 Subject: 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. --- docs/topics/http/shortcuts.txt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'docs/topics/http') 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 ` 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 ` 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 -- cgit v1.3