From 0dcb38f3559cbecf08d15a761dc9b426aef549b7 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jan 04 2016 13:23:48 +0000 Subject: Allow pointing the config file to a file relative to the runserver script --- diff --git a/runserver.py b/runserver.py index 2d8bd56..786da23 100755 --- a/runserver.py +++ b/runserver.py @@ -36,7 +36,11 @@ if args.profile: APP.wsgi_app = ProfilerMiddleware(APP.wsgi_app, restrictions=[30]) if args.config: - os.environ['PAGURE_CONFIG'] = args.config + config = args.config + if not config.startswith('/'): + here = os.path.join(os.path.dirname(os.path.abspath(__file__))) + config = os.path.join(here, config) + os.environ['PAGURE_CONFIG'] = config APP.debug = True APP.run(host='0.0.0.0', port=int(args.port))