You know, I learned this and completely forgot after months of not dealing with it. Google searches are so difficult to reach the right subject.
I’m certain this will be something I refer to in the future..
Setting environment variables via Python is as simple as:
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
Of course, this doesn’t permanently set the variable, but if you have a script that needs that envvar, perfect.
Enjoy.
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.