Registry / web-framework / django-celery-email

django-celery-email

JSON →
library3.0.0pypypiunverified

django-celery-email is an asynchronous email backend for Django that integrates with Celery to send emails in the background. This offloads email sending from the request-response cycle, improving web application responsiveness. The current version is 3.0.0, focusing on compatibility with modern Django and Python versions.

pip install django-celery-email
INSTALL
IMPORT
SIG · DJANGO-CELERY-EMAI
D
django-celery-email
web-frameworkpythonv3.0.0
Install
5.4s avg
Import
Disk
87MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.915 runs
installs and imports cleanly · install 0.0s · import 0.000s · 89.4MB
glibc
py 3.103.915 runs
installs and imports cleanly · install 5.4s · import 0.000s · 90MB
87MB installed
● package 87MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CeleryEmailBackend
from djcelery_email import CeleryEmailBackend
from djcelery_email.backends import CeleryEmailBackend

To use django-celery-email, first ensure Celery and its broker (e.g., Redis) are installed and configured. Then, add 'django_celery_email' to `INSTALLED_APPS` and set `EMAIL_BACKEND` in your Django settings to `django_celery_email.backends.CeleryEmailBackend`. Emails sent via `django.core.mail.send_mail` or similar will then be processed asynchronously by Celery workers.

# settings.py INSTALLED_APPS = [ # ... 'django_celery_email', # ... ] # Configure Celery (e.g., using Redis as a broker) CELERY_BROKER_URL = os.environ.get('CELERY_BROKER_URL', 'redis://localhost:6379/0') # Point Django to use CeleryEmailBackend EMAIL_BACKEND = 'django_celery_email.backends.CeleryEmailBackend' # Optionally, specify the actual backend Celery should use to send emails # Defaults to 'django.core.mail.backends.smtp.EmailBackend' # CELERY_EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' # Optional: Configure Celery task options CELERY_EMAIL_TASK_CONFIG = { 'queue': 'celery_email', 'rate_limit': '50/m', } # Example usage in an app (e.g., views.py) from django.core.mail import send_mail def my_view(request): send_mail( 'Subject here', 'Here is the message.', 'from@example.com', ['to@example.com'], fail_silently=False, ) return HttpResponse('Email scheduled!')
Debug
Known issues
breakingVersion 3.0.0 drops support for older Django and Python versions. Django < 3.2 and Python < 3.8 are no longer supported.
fix
Upgrade your Django installation to 3.2 or higher and Python to 3.8 or higher before upgrading to django-celery-email 3.x.
affects: 3.0.0+
breakingThe `recipient_list_split_size` option and related logic have been removed in version 3.0.0. Task arguments have been simplified.
fix
Remove `recipient_list_split_size` from your `CELERY_EMAIL_TASK_CONFIG` or any custom task configurations. Adapt any custom task definitions to the new simplified arguments.
affects: 3.0.0+
gotchadjango-celery-email requires a fully configured and running Celery setup (broker, result backend, and worker process). It only provides the Django email backend interface, not the Celery infrastructure itself.
fix
Ensure you have Celery and a broker (e.g., Redis, RabbitMQ) properly installed and configured in your Django project, and that your Celery worker process is running and accessible.
affects: All
gotchaBy default, `CELERY_EMAIL_BACKEND` uses Django's built-in `django.core.mail.backends.smtp.EmailBackend`. If you use a different default backend (e.g., a service-specific backend like SendGrid, Mailgun), you must explicitly configure it.
fix
Set `CELERY_EMAIL_BACKEND = 'your.custom.email.backend.Path'` in your `settings.py` if you need Celery to use a specific non-default email backend.
affects: All
Upgrade
Version history
3.0.0latest on PyPI · released Dec 11, 2019
Audit
Dependencies
celeryrequiredRequired for asynchronous task execution.
djangorequiredFramework dependency.
Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
django-celery-email — pip install django-celery-email · libregistry