Answer the question
In order to leave comments, you need to log in
How to store information throughout the program?
Hi everyone again.
In my program, after a person has logged in, I need to save information about his login, in order to later record who performed the actions, and, depending on his login, deny access to some features.
In php, I used sessions for this and it was convenient.
What is the correct and convenient way to implement this in Python? Use a global variable? (I heard it's bad to use global variables)
Answer the question
In order to leave comments, you need to log in
Те же сессии. Где хранить - сам решай, но уж точно не в Local Memory питона, ибо воркеров может быть >1. Redis хорошо подходит.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question