开发者

How to start celery in background of terminal in Django

I ma starting celery as

python manage.py celeryd

It is working but in foreground . Then to test commands i need to start another term开发者_如何学运维inal and do stuff there.

is there any way to start that in background. I tried this

python manage.py celeryd &

But then again it comes at foreground


You're looking for celeryd_detach, available since at least 2.4

python manage.py celeryd_detach


You can use this to get celeryd to work in the background

$ nohup celeryd start &

The above command pushes the celery daemon to the background.


You can try "Supervisor". Install "django-supervisor" in your project, create a supervisor.conf in the same folder than your manage.py.

then, you just run:

python manager.py supervisor --daemonize

My supervisor.conf:

[program:celeryd]
command={{ PYTHON }} {{ PROJECT_DIR }}/manage.py celeryd -l info
autostart=true
autorestart=true
stopwaitsecs = 600

[program:autoreload]
exclude=true
[program:runserver]
exclude=true
[program:celerybeat]
exclude=true
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜