TransWikia.com

uwsgi, multiple environment variables

Server Fault Asked by user204088 on February 25, 2021

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.

2 Answers

That worked for me was append to wsgi.ini file:

env = PARAM_NAME=param_value

Not needed to add " or ' or end with semicolon. If you don't know where is xxx.ini you can see nginx file in /etc/nginx/sites-enabled

Answered by Rutrus on February 25, 2021

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

Answered by Capilé on February 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP