working on cross-session problem #18

main
Mark Cotton 2023-08-21 11:22:17 -05:00
parent 516340f2b4
commit ba7ecb3282
1 changed files with 8 additions and 0 deletions

8
app.py
View File

@ -21,6 +21,8 @@ from EagleEyev3 import *
from settings import config
SECRET_KEY = "this needs to be changed to something unique and not checked into git"
# check if it could pull in a config object from settings.py
if config:
@ -34,6 +36,9 @@ if config:
if 'log_level' in config:
logger.setLevel(config['log_level'])
if 'client_secret' in config:
SECRET_KEY = config['client_secret']
else:
logging.setLevel(config['INFO'])
@ -45,7 +50,10 @@ logging.info(f"Using EagleEyev3 version {EagleEyev3.__version__}")
app = Flask(__name__)
app.secret_key = SECRET_KEY
SESSION_TYPE = 'filesystem'
SESSION_PERMANENT = False
PERMANENT_SESSION_LIFETIME = 60 * 60 * 24 * 7 # one week in seconds
app.config.from_object(__name__)
Session(app)