Closed
Description
Hello there,
I just gave this a try and I can't figure out why I get no results in the admin.
Here's what I tried:
- Generate a project from django cookiecutter so I get Celery with Redis already setup.
- Install
django-celery-email
, add to installed apps and setsettings.EMAIL_BACKEND
- Install
django-celery-results
, add to installed apps and setup as described in the documentation
Here are exact commands to reproduce the issue:
git clone [email protected]:GabLeRoux/django-celery-results-with-redis-example.git
cd django-celery-results-with-redis-example
# checkout the specific commit of the project at the time of creation of this issue
git checkout ace6fcd5ad0099d1054bd42d275f974ef99b81cf
docker-compose up -d
docker-compose logs -f &
# wait for everything to be up, then send a test email that will actually be queued with celery
docker-compose run --rm django python manage.py sendtestemail --admin
Email is successfully sent and does go through the queue using celery. Open a shell and verify the data:
docker-compose run --rm django python manage.py shell_plus
TaskResult.objects.all()
Out[1]: <QuerySet []>
It's empty, that's the problem 😢
The result is shown in flower correctly:
The email is definitely sent correctly too
The result backend doesn't seem to be used correctly or there's something I'm missing here:
Related settings
In [2]: settings.CELERY_BROKER_URL
Out[2]: 'redis://redis:6379/0'
In [3]: settings.CELERY_RESULT_BACKEND
Out[3]: 'django-db'
In [4]: settings.EMAIL_BACKEND
Out[4]: 'djcelery_email.backends.CeleryEmailBackend'
In [5]: settings.INSTALLED_APPS
Out[5]:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'crispy_forms',
'allauth',
'allauth.account',
'allauth.socialaccount',
'rest_framework',
'django_celery_beat',
'django_celery_results',
'djcelery_email',
'example.users.apps.UsersConfig',
'debug_toolbar',
'django_extensions']
Metadata
Metadata
Assignees
Labels
No labels