diff options
author | acenteno | 2020-04-21 17:35:34 -0500 |
---|---|---|
committer | GitHub | 2020-04-21 17:35:34 -0500 |
commit | 660589b9c2a507529e8e51ca6ce66ca97ad982c5 (patch) | |
tree | 27f63957278581bc2fce2b88744bfe20c8a81558 /wqflask/runserver.py | |
parent | d97fdc18359233f07c1a1c7b83fe7e88eb225043 (diff) | |
parent | f2a3ae13231a7d270a5bb6911c248aa713f1ef91 (diff) | |
download | genenetwork2-660589b9c2a507529e8e51ca6ce66ca97ad982c5.tar.gz |
Merge pull request #1 from genenetwork/testing
Updating my testing branch
Diffstat (limited to 'wqflask/runserver.py')
-rw-r--r-- | wqflask/runserver.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/wqflask/runserver.py b/wqflask/runserver.py index 0342b7ad..7c06356b 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. # @@ -11,25 +13,25 @@ import logging import utility.logger logger = utility.logger.getLogger(__name__ ) +import signal +signal.signal(signal.SIGPIPE, signal.SIG_DFL) + BLUE = '\033[94m' 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, @@ -38,7 +40,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, @@ -46,9 +48,9 @@ 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, - processes=8, + processes=0, use_reloader=True) |