From a81dee6c19fc6da7c8a82f6e8844ecff72a909e9 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sat, 6 Nov 2021 17:24:47 +0000 Subject: use permanent session so you don't keep getting signed out --- apioforum/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3