Nginx – uwsgi, multiple environment variables

djangonginxuwsgiwsgi

I am using uWSGI to run a Django application on nginx. I have configured the server and all seems to be running well. What I would really like to be able to do is store the django secret key within the systems environment variables so it is not part of the settings.py file.

I know that somewhere within the uwsgi options there is the ability to pass through multiple environment settings; but I cannot find this. Can someone please tell me how this is done.

Best Answer

Use the uwsgi_param PARAM_NAME 'param_value'; then access with request.environ['PARAM_NAME']