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?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
the ideal way is to
than completely turning off auto escaping.
You can also declare it HTML safe from the code:
Then pass that value to the templates and they don't have to
|safe
it.From the jinja docs section HTML Escaping:
Example: