4π
In ubuntu 10.10 when you install redis it automatically starts at boot, and it was conflicting with celery because apparently even if you tell it to use this or that port if celery can connect to redis in 6379 port it will use it as a backend. Iβve not seen the code but is my conclusion.
So i closed all the redis instances ran my own with my redis.conf on whatever port i want and then i put these on my settings.
BROKER_URL = 'redis://localhost:8889/0'
REDIS_DB = 0
REDIS_CONNECT_RETRY = True
CELERY_RESULT_BACKEND = 'redis'
CELERY_REDIS_PORT = 8889
BROKER_PORT = 8889
CELERY_RESULT_PORT = 8889
CELERY_TASK_RESULT_EXPIRES = 10
CELERYBEAT_SCHEDULER= 'djcelery.schedulers.DatabaseScheduler'
7π
Do you have import djcelery; djcelery.setup_loader()
in your settings.py
?
You can find out where it is trying to connect by running the following:
$ python manage.py celeryctl shell
>>> celery.broker_connection().as_uri()
The βsetup_loaderβ is very important, so you must make sure that you include it.
(the good news is that celery will support Django out of the box for version 2.7).
- [Django]-In Django templates, `Context` is a stack. What for?
- [Django]-Django: How to keep track of a linear (yet flexible) project management workflow?
- [Django]-Embed an external link in django app
- [Django]-Django-CMS: Multiple domains on same project
- [Django]-Django on Google AppEngine with CloudSQL: How to connect database (Error 2002, Can't connect to local MySQL server..)
0π
What version of celery are you using? In the development version it looks like they use a different Decorator;
from celery.task import task
@celery.task()
def add(x, y):
return x + y
- [Django]-Get local system time in Django
- [Django]-How to update where the files are stored in Django app