I'm trying to setup djangocelery to store task results in the databse.
I set:
CELERY_RESULT_BACKEND = 'djcelery.backends.database.DatabaseBackend'
then I synced and migrated the db (no errors).
Celery is working and tasks get processed (I can get the results), but admin shows there is no tasks. In the database are two tables celery_taskmeta
and djcelery_taskmeta
. First one is holding the results and second one is displayed in admin. Anyone has insight how to configure it properly?
Related question with right answer is here.
You should actually run
and
After that tasks results will be displayed in admin (Djcelery › Tasks)
Check the doc, when you use djcelery, set
CELERY_RESULT_BACKEND="database"
or don't even bother to write this line because djcelery sets it by default.The result is stored in
celery_taskmeta
table, you should registerdjcelery.models.TaskMeta
to admin by yourself:Moving the config update e.g.
app.conf.update(CELERY_RESULT_BACKEND='djcelery.backends.database.DatabaseBackend')
to the end of file celery.py did the trick for me .