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: Any
) - > 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 | Any | The variables to make available in the template. |
Returns
| Type | Description |
|---|---|
Iterator[str] | An iterator of strings representing the rendered template content, suitable for streaming responses. |