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.SimpleTemplateResponse.context_data

SimpleTemplateResponse.context_data The context data to be used when rendering the template. It must be a dict. Example: {'foo': 123}

template.response.SimpleTemplateResponse.render()

SimpleTemplateResponse.render() [source] Sets response.content to the result obtained by SimpleTemplateResponse.rendered_content, runs all post-rendering callbacks, and returns the resulting response object. render() will only have an effect the first time it is called. On subsequent calls, it will return the result obtained from the first call.

template.response.SimpleTemplateResponse.is_rendered

SimpleTemplateResponse.is_rendered A boolean indicating whether the response content has been rendered.

template.response.SimpleTemplateResponse

class SimpleTemplateResponse [source]

template.response.SimpleTemplateResponse.add_post_render_callback()

SimpleTemplateResponse.add_post_render_callback() [source] Add a callback that will be invoked after rendering has taken place. This hook can be used to defer certain processing operations (such as caching) until after rendering has occurred. If the SimpleTemplateResponse has already been rendered, the callback will be invoked immediately. When called, callbacks will be passed a single argument – the rendered SimpleTemplateResponse instance. If the callback returns a value that is not None,

template.response.SimpleTemplateResponse.rendered_content

SimpleTemplateResponse.rendered_content The current rendered value of the response content, using the current template and context data.