Home / Function/ stream_template_string() — flask Function Reference

stream_template_string() — flask Function Reference

Architecture documentation for the stream_template_string() function in templating.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  20291251_04b0_a786_a59e_b11df7768862["stream_template_string()"]
  554becd3_25b5_c670_a654_7a20377dec19["templating.py"]
  20291251_04b0_a786_a59e_b11df7768862 -->|defined in| 554becd3_25b5_c670_a654_7a20377dec19
  b7db9b24_d5be_a8c2_55fe_26b8b73ffe93["_get_current_object()"]
  20291251_04b0_a786_a59e_b11df7768862 -->|calls| b7db9b24_d5be_a8c2_55fe_26b8b73ffe93
  7e368e93_5307_3273_cf9b_b38ace3d5f4d["_stream()"]
  20291251_04b0_a786_a59e_b11df7768862 -->|calls| 7e368e93_5307_3273_cf9b_b38ace3d5f4d
  style 20291251_04b0_a786_a59e_b11df7768862 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/templating.py lines 199–211

def stream_template_string(source: str, **context: t.Any) -> t.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.

    :param source: The source code of the template to render.
    :param context: The variables to make available in the template.

    .. versionadded:: 2.2
    """
    ctx = app_ctx._get_current_object()
    template = ctx.app.jinja_env.from_string(source)
    return _stream(ctx, template, context)

Subdomains

Frequently Asked Questions

What does stream_template_string() do?
stream_template_string() is a function in the flask codebase, defined in src/flask/templating.py.
Where is stream_template_string() defined?
stream_template_string() is defined in src/flask/templating.py at line 199.
What does stream_template_string() call?
stream_template_string() calls 2 function(s): _get_current_object, _stream.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free