Django: environment variable for SECRET_KEY not working -


i have secret_key = os.environ['secret_key'] in prod.py, , secret_key=secret_string in .bashrc

this cause 502 error if set secret_key="secret_string", working. how can use environment variable this?

i'm starting gunicorn via sudo service gunicorn restart , have upstart script.

here output of cat /proc/<pid>/environ:

path=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin^@term=linux^@upstart_job=gunicorn^@upstart_instance=^@ 

.bashrc affects bash login shells. init scripts not affected in way it.

you should copy export secret_key=... line top of init script.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -