Skip to content

Commit

Permalink
Chapter 16: Source code profiling (16b)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Oct 26, 2014
1 parent a74f07e commit 72fd00c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,14 @@ def test(coverage=False):
COV.erase()


@manager.command
def profile(length=25, profile_dir=None):
"""Start the application under the code profiler."""
from werkzeug.contrib.profiler import ProfilerMiddleware
app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[length],
profile_dir=profile_dir)
app.run()


if __name__ == '__main__':
manager.run()

0 comments on commit 72fd00c

Please sign in to comment.