template.response.TemplateResponse.__init__()

TemplateResponse.__init__(request, template, context=None, content_type=None, status=None, charset=None, using=None) [source]

Instantiates a TemplateResponse object with the given request, template, context, content type, HTTP status, and charset.

request
An HttpRequest instance.
template
A backend-dependent template object (such as those returned by get_template()), the name of a template, or a list of template names.
context
A dict of values to add to the template context. By default, this is an empty dictionary.
content_type
The value included in the HTTP Content-Type header, including the MIME type specification and the character set encoding. If content_type is specified, then its value is used. Otherwise, DEFAULT_CONTENT_TYPE is used.
status
The HTTP status code for the response.
charset
The charset in which the response will be encoded. If not given it will be extracted from content_type, and if that is unsuccessful, the DEFAULT_CHARSET setting will be used.
using
The NAME of a template engine to use for loading the template.
doc_Django
2016-10-09 18:39:53
Comments
Leave a Comment

Please login to continue.