1

my environment is composed of django, celery and mongodb as a back end.

I managed to create a periodic tasks using djcelery admin interface and after starting celerybeat I can see it runs. This task is simple: it just makes an addition of 2 integers as proposed in celery tutorial.

I launch celeryd with the following command line

python manage.py celeryd -E -l INFO --settings=settings

celerybeat with the following command line:

python manage.py celerybeat --settings=settings

and finally celerycam to take snapshots of my tasks:

python manage.py celerycam --settings=settings

When I try to display celery tasks in djcelery admin however I keep having the same error message, does anyone know how to fix it ?

Error stack django admin

dry
  • 831
  • 2
  • 8
  • 21
  • I am using the following libraries: APScheduler==2.0.2 Django==1.3.1 amqplib==1.0.2 anyjson==0.3.1 celery==2.4.6 celery-with-mongodb==2.4.1 django-celery==2.4.2 django-mongodb-engine==0.4.0 django-picklefield==0.1.9 djangotoolbox==0.9.2 kombu==2.0.0 pymongo==2.1 python-dateutil==1.5 – dry Jan 23 '12 at 11:16

2 Answers2

3

MongoDB does not support advanced date/time lookups like __day, __year, __hour etc, this is why the date_hierarchy thing crashes.

However, the error message is pretty useless. Please open a ticket at https://github.com/django-nonrel/mongodb-engine/issues/ with a link to the full stacktrace (you can get that by clicking the "paste" button on the Django error page).

Possible workarounds:

  1. Override the djcelery admin that causes the trouble, removing the date_hierarchy option
  2. Use django-dbindexer to add support for these lookups by using denormalization.
Jonas H.
  • 2,331
  • 4
  • 17
  • 23
0

In this question it stated that you should set specific Scheduler for the djcelery, but though I have configured this, my admin tasks page is empty (no exception, but does not get populated).

I'm using mysql as a storage for tasks.

Community
  • 1
  • 1
dragoon
  • 5,601
  • 5
  • 37
  • 55
  • Yes, it does not work for me either. Despite setting the correct value for the **CELERYBEAT_SCHEDULER**. I wonder if it is related to mongodb as a backend but not sure. By the way how did you manage to set mysql for the storage of your tasks ? Do you have several back ends ? – dry Jan 23 '12 at 13:57
  • I'm using [djkombu](https://github.com/ask/django-kombu) for this, this way my data and celery tasks are stored in a single place. – dragoon Jan 23 '12 at 20:28