Artem Milosevic
Artem Milosevic

Reputation: 57

Django celery results does not store task results

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.

Upvotes: 1

Views: 3406

Answers (1)

Darsh Modi
Darsh Modi

Reputation: 298

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

Upvotes: 1

Related Questions