class documentation

class SimpleTemplateResponse(HttpResponse):

Known subclasses: django.template.response.TemplateResponse

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method add​_post​_render​_callback Add a new post-rendering callback.
Method render Render (thereby finalizing) the content of the response.
Method resolve​_context Undocumented
Method resolve​_template Accept a template object, path-to-template, or list of paths.
Instance Variable context​_data Undocumented
Instance Variable template​_name Undocumented
Method __getstate__ Raise an exception if trying to pickle an unrendered response. Pickle only rendered data, not the data used to construct the response.
Method __iter__ Undocumented
Method content.setter Set the content for the response.
Class Variable rendering​_attrs Undocumented
Instance Variable ​_is​_rendered Undocumented
Instance Variable ​_post​_render​_callbacks Undocumented
Instance Variable ​_request Undocumented
Instance Variable using Undocumented
Property content Undocumented
Property is​_rendered Undocumented
Property rendered​_content Return the freshly rendered content for the template and context described by the TemplateResponse.

Inherited from HttpResponse:

Method getvalue Undocumented
Method tell Undocumented
Method writable Undocumented
Method write Undocumented
Method writelines Undocumented
Class Variable streaming Undocumented
Method __repr__ Undocumented
Method serialize Full HTTP message, including headers, as a bytestring.
Instance Variable ​_container Undocumented

Inherited from HttpResponseBase (via HttpResponse):

Method __delitem__ Undocumented
Method __getitem__ Undocumented
Method __setitem__ Undocumented
Method charset.setter Undocumented
Method close Undocumented
Method delete​_cookie Undocumented
Method flush Undocumented
Method get Undocumented
Method has​_header Case-insensitive check for a header.
Method items Undocumented
Method make​_bytes Turn a value into a bytestring encoded in the output charset.
Method readable Undocumented
Method reason​_phrase.setter Undocumented
Method seekable Undocumented
Method serialize​_headers HTTP headers as a bytestring.
Method set​_cookie Set a cookie.
Method set​_signed​_cookie Undocumented
Method setdefault Set a header unless it has already been set.
Instance Variable ​_charset Undocumented
Instance Variable ​_handler​_class Undocumented
Instance Variable ​_reason​_phrase Undocumented
Instance Variable ​_resource​_closers Undocumented
Instance Variable closed Undocumented
Instance Variable cookies Undocumented
Instance Variable headers Undocumented
Instance Variable status​_code Undocumented
Property ​_content​_type​_for​_repr Undocumented
Property charset Undocumented
Property reason​_phrase Undocumented
def __init__(self, template, context=None, content_type=None, status=None, charset=None, using=None, headers=None):
def add_post_render_callback(self, callback):

Add a new post-rendering callback.

If the response has already been rendered, invoke the callback immediately.

def render(self):

Render (thereby finalizing) the content of the response.

If the content has already been rendered, this is a no-op.

Return the baked response instance.

def resolve_context(self, context):

Undocumented

def resolve_template(self, template):
Accept a template object, path-to-template, or list of paths.
context_data =

Undocumented

template_name =

Undocumented

def __getstate__(self):
Raise an exception if trying to pickle an unrendered response. Pickle only rendered data, not the data used to construct the response.
def __iter__(self):

Undocumented

@content.setter
def content(self, value):
Set the content for the response.
rendering_attrs: list[str] =

Undocumented

_is_rendered: bool =

Undocumented

_post_render_callbacks: list =

Undocumented

_request =

Undocumented

using =

Undocumented

@property
content =

Undocumented

@property
is_rendered =

Undocumented

@property
rendered_content =

Return the freshly rendered content for the template and context described by the TemplateResponse.

This does not set the final content of the response. To set the response content, you must either call render(), or set the content explicitly using the value of this property.