summaryrefslogtreecommitdiffstats
path: root/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app.py')
-rw-r--r--app.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/app.py b/app.py
index 8d2a5d4..e054c8f 100644
--- a/app.py
+++ b/app.py
@@ -18,6 +18,13 @@ sys.setdefaultencoding('utf-8')
app = Flask(__name__)
app.config.from_pyfile('settings.py')
+if not app.debug:
+ import logging
+ from logging.handlers import RotatingFileHandler
+ file_handler = RotatingFileHandler(app.config['LOG_FILE_PATH'])
+ file_handler.setLevel(logging.WARNING)
+ app.logger.addHandler(file_handler)
+
# populate Module-List
fit = {}
for i, study in enumerate(app.config['STUDIES'].items()):
@@ -135,6 +142,7 @@ def study_index(study, module=None):
def index():
get_img_path = lambda x: os.path.join('images', x +'.png')
studies = [(name,get_img_path(name)) for name,m in app.config['STUDIES'].items()]
+ print(fit)
return render_template(
'index.html',