Created
December 13, 2020 17:49
-
-
Save Julian-Nash/679136bb997eff9b16839af513b63d99 to your computer and use it in GitHub Desktop.
Flask profiler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Flask application profiler | |
Will run the Flask application and log profile data to stdout. | |
The `restrictions` parameter passed to `ProfilerMiddleware` is used to limit the number of items listed | |
in the report. | |
""" | |
import os | |
from werkzeug.middleware.profiler import ProfilerMiddleware | |
from app import create_app | |
app = create_app(os.getenv("FLASK_ENV")) | |
app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[30]) | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example truncated output