Answer the question
In order to leave comments, you need to log in
Why can't I get the value of a variable using os.getenv()?
Hello!
On the local machine in the project, the variable is added to the activate file of the virtual environment, in the project I get its value using os.getenv('varname') .
On the remote server where the project is deployed using django + uwsgi + nginx, a variable is also added to the activate file, but os.getenv constantly returns None, and when activating the environment and going to the django console, os.getenv('varname') returns the correct value .
What's the matter?
UWSGI is installed globally, I run the command /usr/bin/uwsgi --ini /path/uwsgi.ini
Answer the question
In order to leave comments, you need to log in
It is better to install at the daemon level in systemd
serverfault.com/questions/413397/how-to-set-enviro...
If you really want to use
uWSGI
https://github.com/unbit/uwsgi/issues/629
environment variables in virtualenv
stackoverflow.com/questions/9554087/setting-an-env...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question