Vic Nicethemer
Vic Nicethemer

Reputation: 1111

Save Celery tasks to database for monitor in Django admin

I successfully setup Celery 3.1 + Django 1.6 + Djcelery, tasks are working, all good. In Django admin interface i see Djcelery menu with options, but no tasks are visible on Tasks tab, no worker on Workers tab.

How to configure to let them store automatically with statuses?

my settings.py:

    # Celery settings

#BROKER_URL = 'amqp://guest:guest@localhost//'
BROKER_URL = 'django://'

from kombu.serialization import registry
registry.enable('pickle')

#: Only add pickle to this list if your broker is secured
#: from unwanted access (see userguide/security.html)
CELERY_ACCEPT_CONTENT = ['json', 'pickle']
CELERY_TASK_RESULT_EXPIRES=3600
#CELERY_RESULT_BACKEND='amqp'
CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend'
# postgresql
#CELERY_RESULT_BACKEND = 'db+postgresql://postgres:111222@localhost/graphgrail'
#CELERY_RESULT_BACKEND='djcelery.backends.cache:CacheBackend',
CELERY_RESULT_SERIALIZER = 'json' #json pickle msgpack
CELERY_TASK_SERIALIZER = 'json'
CELERY_IMPORTS=["vk_wall.tasks"]

Upvotes: 0

Views: 966

Answers (1)

doniyor
doniyor

Reputation: 37904

you need celerycam

in your uwsgi.ini (if you deployed with it), you need this line:

attach-daemon = /path/to/your/virtualenv/bin/python /var/www/yoursite/manage.py celerycam 

Upvotes: 1

Related Questions