[Django]-Django: celery task does not execute with .delay()

1πŸ‘

βœ…

I am studying celery too and started two days ago. My experience is that, you need to independently deploy your celery well before you integrate it into your web application.

After the visit to the celery doc page I was able to successfully start my celery application.

Start from the simplest demo.

πŸ‘€Carl Lee

5πŸ‘

Can you double-check that you imported the Celery app in your __init__.py file like the getting started guide mentions? https://docs.celeryproject.org/en/latest/django/first-steps-with-django.html

I was having a similar issue where everything else looked correct, but the task was hanging when I used .delay()

Adding the import immediately fixed the problem.

πŸ‘€atm

4πŸ‘

maybe this helps :

you have to update project conf folder init.py file:

from __future__ import absolute_import

# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app  
πŸ‘€Amir.S

Leave a comment