Reputation: 110462
How would I do the following in my wsgi
file, which is imported by apache on production?
$ source env_template.sh
$ python manage.py runserver
>>> Stage: debugging
Validating models...
In my settings file I have stuff like the following, which source
sets:
AWS_ACCESS_KEY = os.environ['AWS_ACCESS_KEY']
I would like apache to load all the variables in env_template.sh on starting it. Am I able to do that in the wsgi.py
file?
Upvotes: 0
Views: 53
Reputation: 799240
Not in any sane manner. I recommend that you either restrict the file to simple "key=value" lines and then parse it out, or move the specific values to separate files and then read them out in both scripts.
Upvotes: 1