[Django]-Django celery error while adding tasks to RabbitMQ message queue : AttributeError: 'ChannelPromise' object has no attribute '__value__'

6👍

To ensure the app is loaded when Django starts, we need to import the Celery app we defined in myproject/init.py:

sudo nano myproject/__init__.py

# 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
__all__ = ['celery_app']

1👍

In my case, I had to add broker_url to my Django app settings. One way to do this is to create an environment variable named CELERY_BROKER_URL.

Leave a comment