class documentation

class SimpleTemplateResponse(HttpResponse): (source)

Known subclasses: django.template.response.TemplateResponse

View In Hierarchy

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 __init__ Undocumented
Method __iter__ Undocumented
Method add_post_render_callback Add a new post-rendering callback.
Method content.setter Set the content for the response.
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.
Class Variable rendering_attrs Undocumented
Instance Variable context_data Undocumented
Instance Variable template_name 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.
Instance Variable _is_rendered Undocumented
Instance Variable _post_render_callbacks Undocumented
Instance Variable _request Undocumented

Inherited from HttpResponse:

Method __repr__ Undocumented
Method getvalue Undocumented
Method serialize Full HTTP message, including headers, as a bytestring.
Method tell Undocumented
Method writable Undocumented
Method write Undocumented
Method writelines Undocumented
Class Variable streaming Undocumented
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 closed Undocumented
Instance Variable cookies Undocumented
Instance Variable headers Undocumented
Instance Variable status_code Undocumented
Property charset Undocumented
Property reason_phrase Undocumented
Instance Variable _charset Undocumented
Instance Variable _handler_class Undocumented
Instance Variable _reason_phrase Undocumented
Instance Variable _resource_closers Undocumented
Property _content_type_for_repr Undocumented
def __getstate__(self): (source)

Raise an exception if trying to pickle an unrendered response. Pickle only rendered data, not the data used to construct the response.

def __init__(self, template, context=None, content_type=None, status=None, charset=None, using=None, headers=None): (source)
def __iter__(self): (source)

Undocumented

def add_post_render_callback(self, callback): (source)

Add a new post-rendering callback. If the response has already been rendered, invoke the callback immediately.

@content.setter
def content(self, value): (source)

Set the content for the response.

def render(self): (source)

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): (source)

Undocumented

def resolve_template(self, template): (source)

Accept a template object, path-to-template, or list of paths.

rendering_attrs: list[str] = (source)

Undocumented

context_data = (source)

Undocumented

template_name = (source)

Undocumented

Undocumented

@property
is_rendered = (source)

Undocumented

@property
rendered_content = (source)

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.

_is_rendered: bool = (source)

Undocumented

_post_render_callbacks: list = (source)

Undocumented