stream_template_string
Render a template from the given source string 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_string(
source: str,
context: Any
) - > Iterator[str]
Render a template from the given source string 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 |
|---|---|---|
| source | str | The source code of the template to render. |
| context | Any | The variables to make available in the template. |
Returns
| Type | Description |
|---|---|
Iterator[str] | An iterator of strings representing the rendered template chunks, suitable for streaming responses. |