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: Any
) - > string

Render a template by name with the given context.

Parameters

NameTypeDescription
template_name_or_list`strTemplate
**contextAnyThe variables to make available in the template.

Returns

TypeDescription
stringThe rendered template content as a string.