Run Django's runserver in supervisor
[program:runserver]
command=bin/python manage.py runserver
stopsignal=KILL
killasgroup=true
Without stopsignal=KILL
and killasgroup=true
(stopasgroup
is available in 3.0a13) there will be an orphaned child process running after supervisorctl shutdown
.
Written by Simon Pantzare
Related protips
3 Responses

Just an update here in case anyone stumbles upon this. If "killasgroup=true" doesn't work for you, try "stopasgroup=true". That's what I needed to get supervisor to properly stop the Django procs.
Thanks!
over 1 year ago
·
Another way is to run
manage.py runserver --noreload
Notice --noreload parameter, which cause Django run on the main thread (but won't reload when a file changes).
For production environments, you should use something more robust. Gunicorn is a great server, and you can run easliy:
gunicorn wsgi:application --bind 127.0.0.1:8000
over 1 year ago
·

stopasgroup=true
works ok... thanks
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#