[Answered ]-How to set environment variable using Django and Python?

2👍

You should not use environ for this case, you should use django session for this type of task
ref here

👤Swagat

0👍

Perhaps you can use django session for that, or just define global variable.

Else :

import os
# set
os.environ["MY_VAR"] = "1"
# get
MY_VAR = os.environ["MY_VAR"]

Leave a comment