Python Flask Render Text from Variable like render_template

You can use render_template_string:

>>> from flask import render_template_string
>>> render_template_string('hello {{ what }}', what="world")
'hello world'

Leave a Comment