Let\'s say I have a Python variable:
list_of_items = [\'1\',\'2\',\'3\',\'4\',\'5\']
and I pass it to Jinja by rendering HTML, and I also h
To add up on the selected answer, I have been testing a new option that is working too using jinja2 and flask:
@app.route('/')
def my_view():
data = [1, 2, 3, 4, 5]
return render_template('index.html', data=data)
The template:
the output of the rendered template:
The safe could be added but as well like {{ data | tojson | safe }} to avoid html escape but it is working without too.