I ma starting celery as
python manage.py celeryd
It is working but in foreground . Then to test commands i need to start another terminal 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With