Skip to main content

Django Q2 Email Backend

An asynchronous Django email backend for Django Q2

Requirements

Installation

  • Install django-q2-email-backend:

pip install django-q2-email-backend
  • Add django_q2_email_backend to INSTALLED_APPS in settings.py:

INSTALLED_APPS = (
    # other apps
    "django_q2_email_backend",
)

Configuration

Django 6.1 and later

Django 6.1 replaced the EMAIL_* settings with MAILERS. Add Q2EmailBackend as your default mailer, with a using option naming the mailer that will do the actual sending in the worker:

MAILERS = {
    "default": {
        "BACKEND": "django_q2_email_backend.backends.Q2EmailBackend",
        "OPTIONS": {"using": "smtp"},
    },
    "smtp": {
        "BACKEND": "django.core.mail.backends.smtp.EmailBackend",
        "OPTIONS": {"host": "smtp.example.com", "use_tls": True},
    },
}

using is required, as the worker would otherwise send through default and queue the message again.

fail_silently belongs on the mailer named by using, which is the one that sends. A silenced failure there leaves a successful task and no email.

Let the queue drain before adding MAILERS. Tasks queued beforehand name no mailer, and Django refuses to build a backend from the deprecated settings once MAILERS exists, so a worker that has it cannot send them.

Django 6.0 and earlier

Set django-q2-email-backend as your EMAIL_BACKEND:

EMAIL_BACKEND = "django_q2_email_backend.backends.Q2EmailBackend"

By default django-q2-email-backend will use Django’s builtin SMTP email backend for the actual sending of the mail. If you’d like to use another backend, you may set it in Q2_EMAIL_BACKEND just like you would normally have set EMAIL_BACKEND before you were using Q2. In fact, the normal installation procedure will most likely be to get your email working using only Django, then change EMAIL_BACKEND to Q2_EMAIL_BACKEND, and then add the new EMAIL_BACKEND setting from above.

EMAIL_BACKEND and Q2_EMAIL_BACKEND are ignored if MAILERS is defined, and stop working in Django 7.0.

Credits

Some code around serializing emails was taken from joeyespo/django-q-email

This package was created with Cookiecutter and the knyghty/cookiecutter-django-package project template.

Metadata

Release files for django-q2-email-backend 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-q2-email-backend 3.0.0
File Size Uploaded Provenance Actions
django_q2_email_backend-3.0.0.tar.gz 7.5 kB With provenance Details for django_q2_email_backend-3.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-q2-email-backend 3.0.0
File Interpreter ABI Platform Actions
django_q2_email_backend-3.0.0-py3-none-any.whl Python 3 none any Details for django_q2_email_backend-3.0.0-py3-none-any.whl

Total release size: 14.9 kB

Release files / django_q2_email_backend-3.0.0.tar.gz

Download URL django_q2_email_backend-3.0.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
99f23c88ca89fc6145d7bc909a86ec70ae9b1f89d3ac489df3946704f9d7f389
BLAKE2b-256 checksum
How to use checksums
29eaafb3580f4f895e619d0a0346495d76b6f063c9b8d92c0352a9a0133e6bbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Release files / django_q2_email_backend-3.0.0-py3-none-any.whl

Download URL django_q2_email_backend-3.0.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f41005d6839fd3efe8da59b6d91c80d2308bff230b4e1545c28a392d8cb181a
BLAKE2b-256 checksum
How to use checksums
66b6be48d0cbfea7a9622aafd85ed71ac1d5211a93b4a7320723dcfe71e004e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Security for django-q2-email-backend 3.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_q2_email_backend-3.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page