Running supervisord from the host, celery from a virtualenv (Django app)

百般思念 提交于 2019-12-05 23:55:57

Path to celery binary is myenv/bin/celery whereas you are using myenv/local/lib/python2.7/site-packages/celery/bin/cel‌‌​​ery.

So if you try on your terminal the command you are passing to supervisor (command=xxx), you should get the same error.

You need to replace your command=xxx in your celery.conf with

command=/home/mhb11/.virtualenvs/myenv/bin/celery -A myproject.celery -l info

Note that I have also replaced -A parameter with celery app, instead of supervisor configuration. This celery app is relevant to your project directory set in celery.conf with

directory = /home/mhb11/somefolder/myproject

On a side note, if you are using Celery with Django, you can manage celery with Django's manage.py, no need to invoke celery directly. Like

python manage.py celery worker
python manage.py celery beat

For detail please read intro of Django Celery here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!