R
R
Rrooom2014-09-16 19:43:33
Django
Rrooom, 2014-09-16 19:43:33

How to integrate celery into django for crontab?

At first I dug into the documentation... But everything is sad, constantly various errors, then I found a tutorial - www.marinamele.com/2014/02/how-to-install-celery-o...
It seems that the current versions.
I got to the "Run It" section, I run "python manage.py celeryd --verbosity=2 --loglevel=DEBUG" iiiiii... Nothing. The script seems to be stuck. I just try runserver - it also hangs.
(By the way, this also happened when I tried examples from the docks)
The only difference is that I have a radish as a broker. DJango 1.7.
How to properly make periodic tasks with celery? What is wrong in the tutorial?
Well, it's kind of a hell of a thing. Separately - it is launched. Generally no problem. And it's worth integrating along the docks with dzhanga - the eternal hangs without any reaction - only kill -9 helps. And nicherta does not google on such a problem.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Simkin, 2014-09-25
@sima007

celery has such a thing - celerybeat . In order for this to work you need to run celery worker with -B
AFAIK - celeryd is a deprecated thing now replaced by celery worker or celery multi which spawns workers.
There are a couple of options for django:
- django-celery, which is actually more convenient. integrated into djanga denser than celery itself (I don’t know if they already support 1.7 and if not, will they)
- Or support from the box, which is poorer than that of the package (More precisely, you need to add code to get features from lib, although I could not find / not understand something).
Actually, all you need is to follow the two tutorials in sequence.
Times celery.readthedocs.org/en/latest/django/first-step...
and two celery.readthedocs.org/en/latest/userguide/periodi...
And of course, look carefully at what they write about django 1.7 (Because stable was released relatively recently - this may well be. Or use celery from the repositories).
Ps: In the tutorial, everything is like that. Just maybe you are looking at a new/old tutorial? Because since version 3.1 (Maybe 3.0) there is old and new way in django connection part. Maybe you are mixing tutorials from them? Although the authors often write noticeably about this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question