I start celery using manage.py celeryd and managing it with a supervisor. In every deployment that modifies the task, I just restart the celery after deploying and restarting apache. \
Edit:
We use chefs to manage our configurations for the supervisor and other processes, so this can be a little killed. We have one master supervisord.conf, which includes a separate configuration file for each site that we run. One of them might look like this:
[program:celery_newproject] command = /srv/www/.virtualenvs/newprojectenv/bin/python /srv/www/projects/newproject/manage.py celeryd --concurrency=2 --settings=settings.alpha --pidfile=/var/run/celery/celery_newproject.pid user = wsgiuser environment = PYTHON_EGG_CACHE="/tmp/.python-eggs"
When deployed, we just run
sudo supervisorctl restart celery_newproject
This restarts the supervisor process for celery and raises all the new tasks that you have defined.
There are other not elegant ways to do this. On my personal sites, I just run a cron job that checks for the presence of a .pid file and restarts the celery if it does not exist. Not very elegant, but it works on sites with low reliability.
source share