diff options
author | ubq323 <ubq323> | 2021-11-06 17:24:47 +0000 |
---|---|---|
committer | ubq323 <ubq323> | 2021-11-06 17:24:47 +0000 |
commit | a81dee6c19fc6da7c8a82f6e8844ecff72a909e9 (patch) | |
tree | cd9167238cfae51df6e19105f8515df6d70cdb4b | |
parent | 17357a3fb5cf603ff79daad644f4a4c0fbe42150 (diff) |
use permanent session so you don't keep getting signed out
-rw-r--r-- | apioforum/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apioforum/__init__.py b/apioforum/__init__.py index 087df81..037afd7 100644 --- a/apioforum/__init__.py +++ b/apioforum/__init__.py @@ -1,7 +1,7 @@ # boilerplate boilerplate boilerplate # yay -from flask import Flask, request +from flask import Flask, request, session from .db import get_db import os @@ -65,6 +65,10 @@ def create_app(): def md_render(s): return render(s) + @app.before_request + def permanent_session(): + session.permanent = True + app.add_url_rule("/",endpoint="index") return app |