[Solved]-Django Celery tutorial not returning results

16๐Ÿ‘

โœ…

I found the solution to my problem from another stackoverflow post: Why does Celery work in Python shell, but not in my Django views? (import problem)

I had to add these lines to my settings file:

CELERY_RESULT_BACKEND = "amqp"
CELERY_IMPORTS = ("app.module.tasks", )

then in the task.py file I named the task as such:

@task(name="module.tasks.add")

The server and the client had to be informed of the task names. The celery and django-celery tutorials omit these lines in their tutorials.

๐Ÿ‘คsequoia

4๐Ÿ‘

if you run celery in debug mode is more easy understand the problem

python manage.py celeryd

What the celery logs says, celery is receiving the task ?
If not probably there is a problem with broker (wrong queue ?)

Give us more detail, in this way we can help you

๐Ÿ‘คMauro Rocco

Leave a comment