D
D
DennyD3142017-06-07 11:25:53
linux
DennyD314, 2017-06-07 11:25:53

Why is the environment variable not exported to the project?

Hello!
On VDS c debin 8, a Django project is deployed, a variable (export foo=bar) is added to the environment.
Activating the virtual environment and running manage.py shell followed by print os.getenv('foo') prints the value of the variable.
But in the project itself, the same command returns none.
Because of what it can be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2017-06-07
@DennyD314

In the configuration of your uwsgi application, set the necessary environment variables:

[uwsgi]
env = foo=bar

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question