Is there a Flask or Jinja2 configuration flag / extension to automatically minify the HTML output after rendering the template?
To extend the usefulness of the answer from @olly_uk and the comment by @Alexander, it appears that the django-htmlmin extension is now designed to be used with frameworks other than Django.
From the docs here, you can manually use the html_minify function in Flask views, like so:
from flask import Flask
from htmlmin.minify import html_minify
app = Flask(__name__)
@app.route('/')
def home():
rendered_html = render_template('home.html')
return html_minify(rendered_html)