aboutsummaryrefslogtreecommitdiff
path: root/wqflask/runserver.py
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/runserver.py')
-rw-r--r--wqflask/runserver.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/wqflask/runserver.py b/wqflask/runserver.py
index 50805643..15572d97 100644
--- a/wqflask/runserver.py
+++ b/wqflask/runserver.py
@@ -1,5 +1,7 @@
# Starts the webserver with the ./bin/genenetwork2 command
#
+# This uses Werkzeug WSGI, see ./run_gunicorn.py for the alternative
+#
# Please note, running with host set externally below combined with
# debug mode is a security risk unless you have a firewall setup, e.g.
#
@@ -7,6 +9,7 @@
from wqflask import app
+
import logging
import utility.logger
logger = utility.logger.getLogger(__name__ )
@@ -19,20 +22,17 @@ GREEN = '\033[92m'
BOLD = '\033[1m'
ENDC = '\033[0m'
-import os
-app.config['SECRET_KEY'] = os.urandom(24)
-
-from utility.tools import WEBSERVER_MODE,get_setting_int
+from utility.startup_config import app_config
-port = get_setting_int("SERVER_PORT")
-
-logger.info("GN2 is running. Visit %shttp://localhost:%s/%s" % (BLUE,port,ENDC))
+app_config()
werkzeug_logger = logging.getLogger('werkzeug')
+from utility.tools import WEBSERVER_MODE, SERVER_PORT
+
if WEBSERVER_MODE == 'DEBUG':
app.run(host='0.0.0.0',
- port=port,
+ port=SERVER_PORT,
debug=True,
use_debugger=False,
threaded=False,
@@ -41,7 +41,7 @@ if WEBSERVER_MODE == 'DEBUG':
elif WEBSERVER_MODE == 'DEV':
werkzeug_logger.setLevel(logging.WARNING)
app.run(host='0.0.0.0',
- port=port,
+ port=SERVER_PORT,
debug=False,
use_debugger=False,
threaded=False,
@@ -49,7 +49,7 @@ elif WEBSERVER_MODE == 'DEV':
use_reloader=True)
else: # staging/production modes
app.run(host='0.0.0.0',
- port=port,
+ port=SERVER_PORT,
debug=False,
use_debugger=False,
threaded=True,