Skip to main content

render_template

Render a template by name with the given context.

def render_template(
template_name_or_list: str | Template | list[str | Template],
context: t.Any
) - > str

Render a template by name with the given context.

Parameters

NameTypeDescription
template_name_or_list`strTemplate
contextt.AnyThe variables to make available in the template.

Returns

TypeDescription
str