diff --git a/runserver.py b/runserver.py index 6184c81..2ee7a0a 100755 --- a/runserver.py +++ b/runserver.py @@ -31,13 +31,6 @@ parser.add_argument( args = parser.parse_args() -from pagure import APP - -if args.profile: - from werkzeug.contrib.profiler import ProfilerMiddleware - APP.config['PROFILE'] = True - APP.wsgi_app = ProfilerMiddleware(APP.wsgi_app, restrictions=[30]) - if args.config: config = args.config if not config.startswith('/'): @@ -45,5 +38,12 @@ if args.config: config = os.path.join(here, config) os.environ['PAGURE_CONFIG'] = config +from pagure import APP + +if args.profile: + from werkzeug.contrib.profiler import ProfilerMiddleware + APP.config['PROFILE'] = True + APP.wsgi_app = ProfilerMiddleware(APP.wsgi_app, restrictions=[30]) + APP.debug = True APP.run(host=args.host, port=int(args.port))