From 4eca4fe9f8765d9137e73024efd3971f5ffee435 Mon Sep 17 00:00:00 2001 From: Lukas Winkler Date: Sun, 13 May 2018 13:43:03 +0200 Subject: [PATCH] improve config thanks to jaytaylor (#2) --- config.sample.py | 9 +++++++-- server.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config.sample.py b/config.sample.py index c32cfd6..bcf1f34 100644 --- a/config.sample.py +++ b/config.sample.py @@ -5,7 +5,12 @@ db = { "passwd": "password", } -# check http://flask.pocoo.org/docs/0.12/quickstart/#sessions on how to create -secret_key = +# Check http://flask.pocoo.org/docs/0.12/quickstart/#sessions on how to create +secret_key = + +# See https://pythonhosted.org/Flask-Session/ +session_type = "filesystem" + +make_cacheable = False production = False diff --git a/server.py b/server.py index f1805f6..1002050 100755 --- a/server.py +++ b/server.py @@ -23,7 +23,7 @@ from models import * app.jinja_env.globals.update(prettydate=utils.prettydate) app.jinja_env.globals.update(is_light_color=utils.is_light_color) -SESSION_TYPE = 'redis' +SESSION_TYPE = config.session_type SESSION_COOKIE_SECURE = config.production SESSION_USE_SIGNER = True SESSION_KEY_PREFIX = "StackDataSessions:"