from jinja2 import Template, DebugUndefined
template = Template('{{ var1 }}-{{ var2 }}', undefined=DebugUndefined)
rendered1 = template.render(var1=5)
print(rendered1)
Multiple renders of jinja2 templates?