Answer the question
In order to leave comments, you need to log in
How to make a global, immutable variable in Django?
I need a variable in Django that stays the same until the user logs out of the site.
That is: I once declared a variable, and even after reloading the site, even after switching to another page, it should have the value that I assigned to it at the very beginning.
I need this for:
So that after the user registers, he does not register again when the site is reloaded, and when he goes to the next page, he remains registered or logged in.
Answer the question
In order to leave comments, you need to log in
Set a cookie. If they cannot be changed by the user, set signed cookies
If you don't understand how django works, follow the tutorial from off site or from django girls
The Soviet state issued the Volga to the honorary reindeer herder. After some time, the journalists decided to find out the opinion of the Chukchi about the award. "Good car." - the Chukchi answers - "It's warm in the cabin, the headlights illuminate the tundra. Only dogs get tired quickly, however."
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question