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:
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.