Passing HTML to template using Flask/Jinja2

sharvey picture sharvey · Jul 8, 2010 · Viewed 109.2k times · Source

I'm building an admin for Flask and SQLAlchemy, and I want to pass the HTML for the different inputs to my view using render_template. The templating framework seems to escape the html automatically, so all <"'> are converted to html entities. How can I disable that so that the HTML renders correctly?

Answer

iamgopal picture iamgopal · Jul 8, 2010

the ideal way is to

{{ something|safe }}

than completely turning off auto escaping.