• notice
  • Congratulations on the launch of the Sought Tech site

Flask session storage is configured in redis

insert image description here
#session is stored in redis cache session
is valid for a long time, if False, close the browser session invalidation
SESSION_PERMANENT=True
#session is valid for a long time, set the session life cycle , the unit is seconds
PERMANENT_SESSION_LIFETIME=60 60 24*14 #Whether
to add salt ( secret), confuse session
SESSION_USE_SIGNER=True #If
you add salt, you must set the security code
SECRET_KEY=str(uuid.uuid4) #Storage
mode
SESSION_TYPE="redis" #Prefix
stored in redis key
SESSION_KEY_PREFIX='axf:'
#redis server Configuration, use 0 library by default
#SESSION_MEMCACHED
#SESSION_MONGODBSE
#SESSION_SALALCHEMY
SESSION_REDIS=Redis(
host="127.0.0.1",
port='6379',
password='123456'
)
insert image description here
--init—.py export
insert image description here
loaded in app.py

insert image description here
insert image description here
insert image description here
Check:
insert image description here
insert image description here


Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+