Commit 94ab5a12 authored by Pierre-Yves Chibon's avatar Pierre-Yves Chibon

Setup the PAGURE_CONFIG env variable before importing pagure's app

parent 6982a6b9
......@@ -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))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment