aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/views.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 8a80c26c..42b20880 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -85,6 +85,10 @@ def connect_db():
g.db = g._database = sqlalchemy.create_engine(SQL_URI, encoding="latin1")
logger.debug(g.db)
+@app.before_request
+def before_request():
+ g.user_session = user_session.UserSession()
+
@app.teardown_appcontext
def shutdown_session(exception=None):
db = getattr(g, '_database', None)