Skip to content

Commit e3bd1aa

Browse files
committed
Add the --profile option to runserver
1 parent 23b148e commit e3bd1aa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

runserver.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
__requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4']
55
import pkg_resources
66

7+
import sys
8+
from werkzeug.contrib.profiler import ProfilerMiddleware
9+
710
from mirrormanager2 import APP
811
APP.debug = True
12+
13+
if '--profile' in sys.argv:
14+
APP.config['PROFILE'] = True
15+
APP.wsgi_app = ProfilerMiddleware(APP.wsgi_app, restrictions=[30])
16+
917
APP.run()

0 commit comments

Comments
 (0)