Django celery results does not store task results

Question:

The problem speaks for itself – django-celery-results does not store any task results.

I did everything as it was described in ‘getting started’ section in documentation, but still no results.

I’m using django 4.1.2 and django-celery-results 2.4.0

Here is related variables from settings.py:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.redis.RedisCache',
        'LOCATION': 'redis://redis:6379',
    }
}
CELERY_BROKER_URL = os.environ.get("CELERY_BROKER", "redis://redis:6379")
CELERY_RESULT_BACKEND = os.environ.get("CELERY_BACKEND", "django-db")
CELERY_CACHE_BACKEND = "django-cache"
CELERY_RESULT_EXTENDED = True

I also tried database cache – nothing changed. How can I get this to work?

UPD: I can create TaskResult and GroupResult objects manually with django admin panel or django shell, the problem is that they are not created automatically.

Asked By: Artem Milosevic

||

Answers:

You have to migrate first then you will able to store such information.Follow this link you will get your solution for sure:

https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html#django-celery-results-using-the-django-orm-cache-as-a-result-backend

Answered By: Darsh Modi
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.