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
Post a Comment