
Generating Secure Dynamic Templates with Jinja2
Generating HTML from within Python is not fun, and actually pretty cumbersome because you have to do the HTML escaping with escape on your own to keep the application secure. Because of that Flask configures the Jinja2 template engine for you automatically. Templates can be used to generate any type of text file. For web applications, you’ll primarily be generating HTML pages, but you can also generate markdown, plain text for emails, and anything else.
FlaskPython