Answer the question
In order to leave comments, you need to log in
Why doesn't supervisor start with django-configurations?
I did it according to the tutorial (launching via manage.py and gunicorn works directly), through the supervisor in the logs I see the following:
>>> Configuration cannot be imported, environment variable DJANGO_CONFIGURATION is undefined.configurations.readthedocs.org/
export DJANGO_CONFIGURATION=TestServ
export DJANGO_SETTINGS_MODULE=MySite.settings
[program:mysite]
command=/home/user/venv/bin/gunicorn MySite.wsgi:application -c /home/user/MySite/MySite/gunicorn.conf.py
directory=/home/user/MySite
user=user
autorestart=true
redirect_stderr=true
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
Answer the question
In order to leave comments, you need to log in
I could not find an answer to the question why the supervisor does not initially see the environment variables, but if someone has a similar problem, then here is a way to pass the virtual environment variables: in the hunicorn config file you need to add:
raw_env = [
"DJANGO_CONFIGURATION=Dev",
"DJANGO_SETTINGS_MODULE=myapp.settings",
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question