I am using celery for distributed task processing. I wanted to deploy my work on a web-host, just to show the working of my project. So how can i get djcelery to use a database (sqlalchemy) as backend with django instead of rabbitmq or other ampq servers.
+2
A:
Here is the Celery docs on "Using Celery with Redis/Database as the messaging queue".
Essentially you need to install ghettoq, add it to your installed apps, add a setting CARROT_BACKEND = "ghettoq.taproot.Database"
and run syncdb. Then magic happens.
Mark Lavin
2010-09-30 13:38:45
hmm that worked thnx...
dcrodjer
2010-10-01 14:06:17
Glad I could help. Another option which we've used for development is `CELERY_ALWAYS_EAGER = True` which just executes the tasks locally without ever sending to the queue. If you just want to run on your dev machine or do a quick demo without setting up the queue this is cheap and dirty way to get it done.
Mark Lavin
2010-10-01 15:28:05
hi Mark, after these settings, a celeryd or celerybeat service need to be running at background as well?
xlione
2010-10-06 17:25:46
If you are using ghettoq then yes you need celeryd running. You only need celerybeat if you have periodic tasks. If you are running `CELERY_ALWAYS_EAGER = True` you do not need celeryd running since everything will run inline.
Mark Lavin
2010-10-06 17:42:08
thanks mark, when i run 'python manage.py celeryd -l INFO' at my django project derectory, it seems fine. but when i started the init script http://github.com/ask/celery/raw/master/contrib/debian/init.d/celerydas celeryd start i got this error 'celery.exceptions.ImproperlyConfigured: Celery needs to be configured to run celeryd'I have configured these # Where the Django project is. CELERYD_CHDIR="/opt/Project/" # Path to celeryd CELERYD="/opt/Project/manage.py celeryd" # Name of the projects settings module. export DJANGO_SETTINGS_MODULE="settings"
xlione
2010-10-06 18:38:11
My guess would be that it's a problem with how you have defined the `DJANGO_SETTINGS_MODULE` and what directories are on your `sys.path` but I don't think the comments are the best place for this. I would open up a new question with your `/etc/default/celeryd` file and the stacktrace of the error.
Mark Lavin
2010-10-06 18:58:34