template.response.SimpleTemplateResponse.resolve_template()

SimpleTemplateResponse.resolve_template(template) [source] Resolves the template instance to use for rendering. Accepts a backend-dependent template object (such as those returned by get_template()), the name of a template, or a list of template names. Returns the backend-dependent template object instance to be rendered. Override this method in order to customize template loading.

template.response.SimpleTemplateResponse.template_name

SimpleTemplateResponse.template_name The name of the template to be rendered. Accepts a backend-dependent template object (such as those returned by get_template()), the name of a template, or a list of template names. Example: ['foo.html', 'path/to/bar.html']

template.response.SimpleTemplateResponse.__init__()

SimpleTemplateResponse.__init__(template, context=None, content_type=None, status=None, charset=None, using=None) [source] Instantiates a SimpleTemplateResponse object with the given template, context, content type, HTTP status, and charset. 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_t

template.response.TemplateResponse

class TemplateResponse [source] TemplateResponse is a subclass of SimpleTemplateResponse that knows about the current HttpRequest.

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

template.Template

class Template [source] This class lives at django.template.Template. The constructor takes one argument — the raw template code: from django.template import Template template = Template("My name is {{ my_name }}.") Behind the scenes The system only parses your raw template code once – when you create the Template object. From then on, it’s stored internally as a tree structure for performance. Even the parsing itself is quite fast. Most of the parsing happens via a single call to a singl

template.Template.render()

Template.render(context) [source] Call the Template object’s render() method with a Context to “fill” the template: >>> from django.template import Context, Template >>> template = Template("My name is {{ my_name }}.") >>> context = Context({"my_name": "Adrian"}) >>> template.render(context) "My name is Adrian." >>> context = Context({"my_name": "Dolores"}) >>> template.render(context) "My name is Dolores."

Templates

Django’s template engine provides a powerful mini-language for defining the user-facing layer of your application, encouraging a clean separation of application and presentation logic. Templates can be maintained by anyone with an understanding of HTML; no knowledge of Python is required. For introductory material, see Templates topic guide. The Django template languageTemplates Variables Filters Tags Comments Template inheritance Automatic HTML escaping Accessing method calls Custom tag and f

test.Client

class Client(enforce_csrf_checks=False, **defaults) [source] It requires no arguments at time of construction. However, you can use keywords arguments to specify some default headers. For example, this will send a User-Agent HTTP header in each request: >>> c = Client(HTTP_USER_AGENT='Mozilla/5.0') The values from the extra keywords arguments passed to get(), post(), etc. have precedence over the defaults passed to the class constructor. The enforce_csrf_checks argument can be used

test.Client.cookies

Client.cookies A Python SimpleCookie object, containing the current values of all the client cookies. See the documentation of the http.cookies module for more.