I have a string that I want to treat as a Jinja template. I tried returning the string, but it gets sent as is, Jinja doesn't render it. I do not want to make a template file to render it with render_template
. How can I render the string with Jinja?
@app.route('/results')
def results():
template = '''<div class="results">
{% for option in options() %}
<p>{{ option }}</p>
{% endfor %}
</div>
'''
return template