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. :param source: The source code of the template to render. :param context: The variables to make available in
(source: str, **context: t.Any)
| 206 | |
| 207 | |
| 208 | def stream_template_string(source: str, **context: t.Any) -> t.Iterator[str]: |
| 209 | """Render a template from the given source string with the given |
| 210 | context as a stream. This returns an iterator of strings, which can |
| 211 | be used as a streaming response from a view. |
| 212 | |
| 213 | :param source: The source code of the template to render. |
| 214 | :param context: The variables to make available in the template. |
| 215 | |
| 216 | .. versionadded:: 2.2 |
| 217 | """ |
| 218 | app = current_app._get_current_object() # type: ignore[attr-defined] |
| 219 | template = app.jinja_env.from_string(source) |
| 220 | return _stream(app, template, context) |
nothing calls this directly
no test coverage detected
searching dependent graphs…