diff options
author | Pjotr Prins | 2016-10-03 08:07:00 +0000 |
---|---|---|
committer | Pjotr Prins | 2016-10-03 08:07:00 +0000 |
commit | e1ba11b55fe849737a649939156c56fe90b0d3e9 (patch) | |
tree | cfaa1cd2c217d708c4a5a0f68f04537f587f8735 /wqflask | |
parent | 358f0cd5e8f3e23ca059c3fd5c1c5739faaeb425 (diff) | |
download | genenetwork2-e1ba11b55fe849737a649939156c56fe90b0d3e9.tar.gz |
Config: use server port setting
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/runserver.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/wqflask/runserver.py b/wqflask/runserver.py index 12ec904e..5a8766b0 100644 --- a/wqflask/runserver.py +++ b/wqflask/runserver.py @@ -16,34 +16,38 @@ GREEN = '\033[92m' BOLD = '\033[1m' ENDC = '\033[0m' -logger.info("GN2 is running. Visit %shttp://localhost:5003/%s" % (BLUE,ENDC)) import os app.config['SECRET_KEY'] = os.urandom(24) -from utility.tools import WEBSERVER_MODE +from utility.tools import WEBSERVER_MODE,get_setting_int + +port = get_setting_int("SERVER_PORT") + +logger.info("GN2 is running. Visit %shttp://localhost:%s/%s" % (BLUE,port,ENDC)) werkzeug_logger = logging.getLogger('werkzeug') if WEBSERVER_MODE == 'DEBUG': app.run(host='0.0.0.0', - port=app.config['SERVER_PORT'], + port=port, debug=True, - use_debugger=True, + use_debugger=False, threaded=False, + processes=0, use_reloader=True) elif WEBSERVER_MODE == 'DEV': werkzeug_logger.setLevel(logging.WARNING) app.run(host='0.0.0.0', - port=app.config['SERVER_PORT'], + port=port, debug=False, use_debugger=False, threaded=False, processes=0, use_reloader=True) -else: #production mode +else: # staging/production modes app.run(host='0.0.0.0', - port=app.config['SERVER_PORT'], + port=port, debug=False, use_debugger=False, threaded=True, |