Django & Celery using manage.py

1.5k views Asked by At

I'm using Django 1.6 and Celery 3.1.1

Back when the django-celery app was required I didn't seem to have a problem. Using the new method of running celery, I can get it to work, but I can't seem to get celerycam working.

If try to run ./manage.py celeryd -B -E I get the following error:

consumer: Cannot connect to amqp://[email protected]:5672//: [Errno 111] Connection refused.

It is completely ignoring my BROKER_URL in settings.py. I've set up the celery.py file described in the docs and it all seems to work.

Now I want to run celerycam, which as I understand does require django-celery still. When I try to run celerycam (./manage.py celerycam) I get the following error:

socket.error: [Errno 111] Connection refused

I assume this is the same reason I get the error trying to call celeryd from manage.py - because it is not reading my settings.py file. Anyone know how I can get django-celery to read my BROKER_URL setting?

2

There are 2 answers

0
Dustin On

As often happens, the act of typing out my project led to my solution.

Adding the following fixed my issue:

import djcelery
djcelery.setup_loader()
0
Oscar On

Doesn't those lines require django-celery again, which is already discouraged since celery 3.1+?