A
A
Alexander Rublev2016-03-27 21:26:52
Python
Alexander Rublev, 2016-03-27 21:26:52

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

1 answer(s)
R
Roman Kitaev, 2016-03-27
@deliro

Те же сессии. Где хранить - сам решай, но уж точно не в Local Memory питона, ибо воркеров может быть >1. Redis хорошо подходит.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question