This is my tree (hidding all the unnecesary stuff):
src/
├─ api/
│ ├─ app1/
│ │ ├─ tasks.py
│ │ ├─ models.py
│ ├─ celeryworker/
│ │ ├─ celery.py
│ ├─ settings.py
│ ├─ urls.py
├─ manage.py
├─ setup.py
And then this is my celery.py
from __future__ import absolute_import
from celery import Celery
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api.settings')
app = Celery('portal')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
when I am trying to run this app:
cd src/api
celery -A celeryworker worker --loglevel=INFO
I am getting:
ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused.
moreover, printing print(app.conf) doesn't seem to be setting any of my CELERY_ settings that I have specified in src/api/settings.py
How can I make my celery worker read the Django settings properly?
settings.pylook like?