def debug_app(app):
"""Add the debug toolbar extension to the application."""
app.jinja_env.undefined = jinja2.StrictUndefined
try:
import flask_debugtoolbar
except ImportError:
flask_debugtoolbar = None
else:
app.config['SECRET_KEY'] = 'debug-secret-key'
flask_debugtoolbar.DebugToolbarExtension(app)
评论列表
文章目录