stream_template
Render a template by name with the given context as a stream. This returns an iterator of strings, which can be used as a streaming response from a view.
def stream_template(
template_name_or_list: str | Template | list[str | Template],
context: t.Any
) - > t.Iterator[str]
Render a template by name with the given context as a stream. This returns an iterator of strings, which can be used as a streaming response from a view.
Parameters
| Name | Type | Description |
|---|---|---|
| template_name_or_list | `str | Template |
| context | t.Any | The variables to make available within the template during rendering. |
Returns
| Type | Description |
|---|---|
t.Iterator[str] | An iterator of strings representing the rendered template content. |