2

I am running a django site using uWSGI in emperor mode. I have found that while touching the uwsgi.ini file for a specific application does indeed cause the emperor process to reload that vassal (according to the log file) that a reload is not enough to pick up changes. Specifically changes to the .env file used to configure the django site.

If I move the app specific uwsgi.ini file out of the vassals folder and back in it will work. Presumably because the emperor process kills the vassals once the .ini file is missing and the restarts them when the file reappears. Also restarting the uwsgi emperor using systemd works as well.

I rather not restart the emperor process and the process of moving the ini file around feels awful clunky.

What is the right way to restart single Django site behind emperor and still pick up changes to the site settings?

/etc/uwsgi/emperor.ini

[uwsgi]
emperor = /etc/uwsgi/vassals
uid = www-data
gid = www-data
limit-as = 1024
logto = /tmp/uwsgi.log

/etc/uwsgi/vassals/demo-app.ini

[uwsgi]
chdir=/home/demo-app/demo-app
virtualenv=/home/demo-app/.venv
module=demo_app.wsgi

master = true
processes = 2

socket = 127.0.0.1:1111
chmod-socket = 664
vacuum = true

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.