{"id":8942,"library":"django-celery-email","title":"Django Celery Email","description":"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.","status":"active","version":"3.0.0","language":"en","source_language":"en","source_url":"https://github.com/pmclanahan/django-celery-email","tags":["django","celery","email","async","backend"],"install":[{"cmd":"pip install django-celery-email","lang":"bash","label":"Install package"}],"dependencies":[{"reason":"Required for asynchronous task execution.","package":"celery","optional":false},{"reason":"Framework dependency.","package":"django","optional":false}],"imports":[{"symbol":"CeleryEmailBackend","correct":"from django_celery_email.backends import CeleryEmailBackend"}],"quickstart":{"code":"# settings.py\n\nINSTALLED_APPS = [\n    # ...\n    'django_celery_email',\n    # ...\n]\n\n# Configure Celery (e.g., using Redis as a broker)\nCELERY_BROKER_URL = os.environ.get('CELERY_BROKER_URL', 'redis://localhost:6379/0')\n\n# Point Django to use CeleryEmailBackend\nEMAIL_BACKEND = 'django_celery_email.backends.CeleryEmailBackend'\n\n# Optionally, specify the actual backend Celery should use to send emails\n# Defaults to 'django.core.mail.backends.smtp.EmailBackend'\n# CELERY_EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'\n\n# Optional: Configure Celery task options\nCELERY_EMAIL_TASK_CONFIG = {\n    'queue': 'celery_email',\n    'rate_limit': '50/m',\n}\n\n# Example usage in an app (e.g., views.py)\nfrom django.core.mail import send_mail\n\ndef my_view(request):\n    send_mail(\n        'Subject here',\n        'Here is the message.',\n        'from@example.com',\n        ['to@example.com'],\n        fail_silently=False,\n    )\n    return HttpResponse('Email scheduled!')","lang":"python","description":"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."},"warnings":[{"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.","message":"Version 3.0.0 drops support for older Django and Python versions. Django < 3.2 and Python < 3.8 are no longer supported.","severity":"breaking","affected_versions":"3.0.0+"},{"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.","message":"The `recipient_list_split_size` option and related logic have been removed in version 3.0.0. Task arguments have been simplified.","severity":"breaking","affected_versions":"3.0.0+"},{"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.","message":"django-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.","severity":"gotcha","affected_versions":"All"},{"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.","message":"By 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.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install Celery: `pip install celery` (and optionally a broker like `pip install redis`).","cause":"Celery is not installed or not available in the Python environment where django-celery-email is running.","error":"ModuleNotFoundError: No module named 'celery'"},{"fix":"Ensure you have a `celery.py` file in your Django project, and start your Celery worker from your project root: `celery -A your_project_name worker -l info`.","cause":"This error typically indicates that your Celery application is not correctly defined or discovered, or the Celery worker was started without pointing to your Django project.","error":"RuntimeError: No application found. You did not specify an application."},{"fix":"Verify your Celery worker is running (`celery -A your_project_name worker -l info`). Check Celery broker configuration (`CELERY_BROKER_URL`) and ensure the broker service (e.g., Redis server) is running and accessible.","cause":"The Celery worker is not running, is misconfigured, or cannot connect to the broker.","error":"Emails are not sending, or tasks are stuck in 'PENDING' state."}]}