Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Celery: Unable to run a task using Django with either database or redis as the backend [RSS Feed]

#1 June 12, 2010 20:42:47

s.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Celery: Unable to run a task using Django with either database or redis as the backend


Hi there,

I need to use a task queue for Django, and Celery seems ideal,
unfortunately I can't install RabbitMQ on my server, so I need to use
an alternate backend (I have Redis and MySQL available).
Unfortunately, I can't get either to work :\

I'm using Celery 1.0.5 with Django 1.2.1, I've added celery to my
INSTALLED_APPS and I've synched the database to create the
celery_taskmeta and celery_tasksetmeta tables.

I'm now following the instructions here:http://celeryproject.org/docs/tutorials/otherqueues.htmlfor setting up MySQL as the backend. In my settings.py I have:

DATABASE_ENGINE = 'mysql'
DATABASE_NAME = 'django'
DATABASE_USER = 'django'
DATABASE_PASSWORD = 'django'
DATABASE_HOST = ''
DATABASE_PORT = ''

CARROT_BACKEND = "ghettoq.taproot.Database"
CELERY_RESULT_BACKEND = "database"
CELERY_RESULT_DBURI = "mysql://django:dja...@localhost/django"
CELERY_DEFAULT_EXCHANGE = "tasks"
CELERYD_LOG_LEVEL = "DEBUG"

INSTALLED_APPS = (
'celery',
'ghettoq',
...
)

I now have a task defined which I can run as follows:

$ python manage.py shell
>> from mysite.myapp.models import TaskTest
>> result = TaskTest.add.delay(5,6)
>> result.ready()
False

But when I run celeryd, the task is never run:

$ python manage.py celeryd
Configuration ->
. broker -> ghettoq.taproot.Database://n...@none/
. queues ->
. celery -> exchange:tasks (direct) binding:celery
. concurrency -> 2
. loader -> celery.loaders.djangoapp.Loader
. logfile ->

Offline

  • Root
  • » Django
  • » Celery: Unable to run a task using Django with either database or redis as the backend [RSS Feed]

Board footer

Moderator control

Enjoy the 14th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support