Skip to main content

render_template_string

Render a template from the given source string with the given context.

def render_template_string(
source: string,
context: Any
) - > string

Render a template from the given source string with the given context.

Parameters

NameTypeDescription
sourcestringThe source code of the template to render.
contextAnyThe variables to make available in the template.

Returns

TypeDescription
stringThe rendered template as a string, with all variables and logic processed.