Yes, you can use the same celery server to receive tasks from individual projects.
If you have a separate application for celery (or just one file), say foo , which has all the tasks that are used in different projects.
Running a worker to complete tasks
celery worker -l info -A foo
Now from project A you can call add
import celery celery.current_app.send_task('foo.add', args=(1, 2))
And from project B you can call sub
import celery celery.current_app.send_task('foo.sub', args=(1, 2))
You can use supervisord to control a celery worker.
This approach may be a little more difficult to test, because send_task will not respect CELERY_ALWAYS_EAGER . However, you can use this snippet to get CELERY_ALWAYS_EAGER send_task .
source share