Django
Set Global Variable using settings.py
BenzhaminKim
2020. 10. 29. 14:17
You want to use environment variables, so I'm going to talk about how to use it.
First, you need to define the variable you want to use on settings.py
Then, you set a variable on the file you want to use.
Here, by using getattr(), you can set the variable. If you don't havr the attribute inside the class, then the third parameter,which is 15 in this case, replace for the variable.