Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does django's runserver option provide a hook for running other restart scripts?

I've recently been playing around with django and celery. One annoying thing during development is the fact that I have to restart the celery daemon each time I modify a task. When I'm developing, I usually like to use 'manage.py runserver' which automatically reloads the django framework on modifications to my apps.

Is there a way to add a hook to the reloading process that runserver does so that it automatically restarts the celery daemon I have running?

Alternatively, does celery have a similar monitor-and-reload-on-change mode that I should be using for development?

like image 837
GrantJ Avatar asked Mar 01 '11 17:03

GrantJ


1 Answers

Django-supervisor works very well for this purpose. You can have it start the Django server, Celery, and anything else you need, and have different configurations for development and production servers. It also knows to reload the celery daemon when your code changes. https://github.com/rfk/django-supervisor

like image 185
LS55321 Avatar answered Nov 02 '22 14:11

LS55321