diff options
author | Sam Ockman | 2012-08-23 15:57:37 -0400 |
---|---|---|
committer | Sam Ockman | 2012-08-23 15:57:37 -0400 |
commit | 300f2fec72ce8e7143e0c954074690224f6d0f70 (patch) | |
tree | cafeae409d29c4c362bbac40d39ba1eb8f406d9d /wqflask | |
parent | c19117809b845849d1f7962b19eb16aa529c5975 (diff) | |
download | genenetwork2-300f2fec72ce8e7143e0c954074690224f6d0f70.tar.gz |
Version with official config support
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/cfg/__init__.py | 0 | ||||
-rw-r--r-- | wqflask/cfg/default_settings.py | 1 | ||||
-rw-r--r-- | wqflask/wqflask/__init__.py | 4 | ||||
-rw-r--r-- | wqflask/wqflask/search_results.py | 2 |
4 files changed, 6 insertions, 1 deletions
diff --git a/wqflask/cfg/__init__.py b/wqflask/cfg/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/wqflask/cfg/__init__.py diff --git a/wqflask/cfg/default_settings.py b/wqflask/cfg/default_settings.py new file mode 100644 index 00000000..30ad51d1 --- /dev/null +++ b/wqflask/cfg/default_settings.py @@ -0,0 +1 @@ +LOGFILE = """/tmp/flask_gn_log""" diff --git a/wqflask/wqflask/__init__.py b/wqflask/wqflask/__init__.py index a6119dcc..a7492e77 100644 --- a/wqflask/wqflask/__init__.py +++ b/wqflask/wqflask/__init__.py @@ -9,6 +9,10 @@ from utility import formatting app = Flask(__name__) +# See http://flask.pocoo.org/docs/config/#configuring-from-files +app.config.from_object('cfg.default_settings') +app.config.from_envvar('WQFLASK_SETTINGS') + app.jinja_env.globals.update( numify = formatting.numify ) diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py index ce7a6eef..d393d0c1 100644 --- a/wqflask/wqflask/search_results.py +++ b/wqflask/wqflask/search_results.py @@ -36,7 +36,7 @@ from utility import webqtlUtil from dbFunction import webqtlDatabaseFunction import logging -logging.basicConfig(filename="/tmp/flask_gn_log", level=logging.INFO) +logging.basicConfig(filename=app.config['LOGFILE'], level=logging.INFO) _log = logging.getLogger("search") _ch = logging.StreamHandler() |