diff options
author | Frederick Muriuki Muriithi | 2023-06-16 09:59:45 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-06-20 13:36:50 +0300 |
commit | 7127095f2b2c54175d1360c1ddb3e0f87b6ede98 (patch) | |
tree | a270e5ba15420bd5f684a8712bf3a3e44097bc94 /wqflask/runserver.py | |
parent | fe070958a46acd81aeb66ba6326202118f72d5b8 (diff) | |
download | genenetwork2-7127095f2b2c54175d1360c1ddb3e0f87b6ede98.tar.gz |
configs: set mandatory settings in the app
Set up the mandatory settings in the `flask.current_app.config` object
rather than in the file itself.
Diffstat (limited to 'wqflask/runserver.py')
-rw-r--r-- | wqflask/runserver.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wqflask/runserver.py b/wqflask/runserver.py index 6dedbd24..8f01425e 100644 --- a/wqflask/runserver.py +++ b/wqflask/runserver.py @@ -9,7 +9,7 @@ from wqflask import app from utility.startup_config import app_config -from utility.tools import WEBSERVER_MODE, SERVER_PORT +from utility.configuration import get_setting, get_setting_int import logging @@ -22,19 +22,19 @@ app_config(app) werkzeug_logger = logging.getLogger('werkzeug') -if WEBSERVER_MODE == 'DEBUG': +if get_setting(app, "WEBSERVER_MODE") == 'DEBUG': app.debug = True app.run(host='0.0.0.0', - port=SERVER_PORT, + port=get_setting_int(app, "SERVER_PORT"), debug=True, use_debugger=False, threaded=False, processes=0, use_reloader=True) -elif WEBSERVER_MODE == 'DEV': +elif get_setting(app, "WEBSERVER_MODE") == 'DEV': werkzeug_logger.setLevel(logging.WARNING) app.run(host='0.0.0.0', - port=SERVER_PORT, + port=get_setting_int(app, "SERVER_PORT"), debug=False, use_debugger=False, threaded=False, @@ -42,7 +42,7 @@ elif WEBSERVER_MODE == 'DEV': use_reloader=True) else: # staging/production modes app.run(host='0.0.0.0', - port=SERVER_PORT, + port=get_setting_int(app, "SERVER_PORT"), debug=False, use_debugger=False, threaded=True, |