aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2016-10-03 08:07:00 +0000
committerPjotr Prins2016-10-03 08:07:00 +0000
commite1ba11b55fe849737a649939156c56fe90b0d3e9 (patch)
treecfaa1cd2c217d708c4a5a0f68f04537f587f8735
parent358f0cd5e8f3e23ca059c3fd5c1c5739faaeb425 (diff)
downloadgenenetwork2-e1ba11b55fe849737a649939156c56fe90b0d3e9.tar.gz
Config: use server port setting
-rw-r--r--wqflask/runserver.py18
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,