Home / Function/ render_template_string() — flask Function Reference

render_template_string() — flask Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  ae2a3f88_c334_d39e_9e69_d55cf39c2508["render_template_string()"]
  554becd3_25b5_c670_a654_7a20377dec19["templating.py"]
  ae2a3f88_c334_d39e_9e69_d55cf39c2508 -->|defined in| 554becd3_25b5_c670_a654_7a20377dec19
  b7db9b24_d5be_a8c2_55fe_26b8b73ffe93["_get_current_object()"]
  ae2a3f88_c334_d39e_9e69_d55cf39c2508 -->|calls| b7db9b24_d5be_a8c2_55fe_26b8b73ffe93
  d39cf1b5_5a41_f48f_3c8e_c8e0ac439c62["_render()"]
  ae2a3f88_c334_d39e_9e69_d55cf39c2508 -->|calls| d39cf1b5_5a41_f48f_3c8e_c8e0ac439c62
  style ae2a3f88_c334_d39e_9e69_d55cf39c2508 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/templating.py lines 150–159

def render_template_string(source: str, **context: t.Any) -> str:
    """Render a template from the given source string with the given
    context.

    :param source: The source code of the template to render.
    :param context: The variables to make available in the template.
    """
    ctx = app_ctx._get_current_object()
    template = ctx.app.jinja_env.from_string(source)
    return _render(ctx, template, context)

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free