aboutsummaryrefslogtreecommitdiff
path: root/wqflask/runserver.py
diff options
context:
space:
mode:
authorPjotr Prins2016-06-18 07:36:14 +0000
committerPjotr Prins2016-06-18 07:36:14 +0000
commit3a59631a4a95f4b4a1911e3a10912cdcbdf31200 (patch)
treee9de0dd9d919ee5d27b3faa1698a37eeec18cba6 /wqflask/runserver.py
parentc93dfd2a6343690fdcfcb4b5dcb231f0ee4dc8fd (diff)
downloadgenenetwork2-3a59631a4a95f4b4a1911e3a10912cdcbdf31200.tar.gz
Logging: behaviours
Diffstat (limited to 'wqflask/runserver.py')
-rw-r--r--wqflask/runserver.py34
1 files changed, 23 insertions, 11 deletions
diff --git a/wqflask/runserver.py b/wqflask/runserver.py
index bc54130c..f40d8a48 100644
--- a/wqflask/runserver.py
+++ b/wqflask/runserver.py
@@ -22,16 +22,28 @@ from wqflask import app
print app.config
-import logging
-file_handler = logging.FileHandler(app.config['LOGFILE'])
-file_handler.setLevel(logging.DEBUG)
-app.logger.addHandler(file_handler)
-
from utility.tools import WEBSERVER_MODE
-app.run(host='0.0.0.0',
- port=app.config['SERVER_PORT'],
- debug=(WEBSERVER_MODE=='DEBUG'),
- use_debugger=(WEBSERVER_MODE=='DEBUG'),
- threaded=(WEBSERVER_MODE=='PROD'),
- use_reloader=True)
+if WEBSERVER_MODE == 'DEBUG':
+ app.run(host='0.0.0.0',
+ port=app.config['SERVER_PORT'],
+ debug=True,
+ use_debugger=True,
+ threaded=False,
+ use_reloader=True)
+elif WEBSERVER_MODE == 'DEV':
+ app.run(host='0.0.0.0',
+ port=app.config['SERVER_PORT'],
+ debug=False,
+ use_debugger=False,
+ threaded=False,
+ processes=0,
+ use_reloader=True)
+else: #production mode
+ app.run(host='0.0.0.0',
+ port=app.config['SERVER_PORT'],
+ debug=False,
+ use_debugger=False,
+ threaded=True,
+ processes=8,
+ use_reloader=True)