Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

OK I have Django, nginx and uWSGI set up on my server...the problem is I start uWSGI manually via this command:

uwsgi -s /home/user/sites/sock/uwsgi.sock -t 10 -M -p 1 -C --pythonpath /home/user/sites/ -w mysite.django_wsgi

And it's working great. The thing I would like to do is use supervisord to control the uWSGI processes (start, stop, etc.). How would I do this, what would the supervisord config look like?

share|improve this question
up vote 4 down vote accepted

I found this was pretty confusing until I discovered emperor mode.

This means you can do one supervisord instance to manage all of your configs:

command=/usr/local/bin/uwsgi --emperor /etc/uwsgi/apps-enabled

And then you'd pop any config files (ini, xml, yaml) for apps into the /etc/uwsgi/apps-enabled directory.

Not sure if this works with 0.9, but defintely works with 1.0.

Here's an example ini for a Flask app:

socket = /tmp/uwsgi_%n.sock
module = wire:app
chdir = /srv/%n/wire
env = WIRE_SETTINGS=/srv/%n/wire/
virtualenv = /srv/%n
uid = wire
gid = www-data
single-interpreter = false
chmod = 770
processes = 3
share|improve this answer

Have a look at this: You maybe have to adapt some parts, but shows how it works ;)

share|improve this answer

Here is a working supervisor conf file (normal mode, not emperor mode) :

  --home frite_prod
  --module frite_deploy_wsgi
  --socket /home/frite/envs/frite_prod/frite.sock
  --chmod-socket 666
  --pythonpath /home/mep/envs/frite_prod/fr-frite
  --pythonpath /home/mep/envs/frite_prod/fr-frite/frite
  --processes 8
  --master -L -l 250 -z 5
  --post-buffering 1

Your app need to be installed in a virtualenv. (And in this example I have the app running as "frite" user. So I have created a unix user with sudo addusr or something and put the virtualenvs and files there. So that it's isolated from the rest of the system.

And is a kind of launcher that contains only :

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.