MCPcopy
hub / github.com/pallets/flask / render_template

Function render_template

src/flask/templating.py:139–151  ·  view source on GitHub ↗

Render a template by name with the given context. :param template_name_or_list: The name of the template to render. If a list is given, the first name to exist will be rendered. :param context: The variables to make available in the template.

(
    template_name_or_list: str | Template | list[str | Template],
    **context: t.Any,
)

Source from the content-addressed store, hash-verified

137
138
139def render_template(
140 template_name_or_list: str | Template | list[str | Template],
141 **context: t.Any,
142) -> str:
143 """Render a template by name with the given context.
144
145 :param template_name_or_list: The name of the template to render. If
146 a list is given, the first name to exist will be rendered.
147 :param context: The variables to make available in the template.
148 """
149 app = current_app._get_current_object() # type: ignore[attr-defined]
150 template = app.jinja_env.get_or_select_template(template_name_or_list)
151 return _render(app, template, context)
152
153
154def render_template_string(source: str, **context: t.Any) -> str:

Callers 13

indexFunction · 0.90
missing_templateFunction · 0.90
indexFunction · 0.90
index2Function · 0.90
return_templateFunction · 0.90
dispatch_requestMethod · 0.90
indexFunction · 0.90
createFunction · 0.90
updateFunction · 0.90
registerFunction · 0.90
loginFunction · 0.90
indexFunction · 0.90

Calls 1

_renderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…