📨 Django mails. Supercharged.
Overview
django-nitro-mailer is a pluggable Django app that provides extra email reliability and observability in form of email backends that can be used with Django's built-in functions and other email backend.
django-nitro-mailer by itself does not provide a way to send emails, but it puts an extra layer before the email backend to provide extra features like:
- priority queueing
- retrying failed emails
- logging and traces
- email throttling
- sending messages through the admin panel
Requirements
- Python >=3.10, <3.15
- Django >=5.2, <7.0
Installation
Install the package using pip:
$ pip install django-nitro-mailer
Usage
- Add
django_nitro_mailerto yourINSTALLED_APPSin yoursettings.py:
INSTALLED_APPS = [
...
"django_nitro_mailer",
...
]
-
Run
python manage.py migrateto create the necessary tables. -
Change the
EMAIL_BACKENDsetting in yoursettings.pyto use the desired backend:
- Database Backend: Store emails in the database and send them asynchronously. Requires sending a cron job or some other scheduled task to send the emails.
EMAIL_BACKEND = "django_nitro_mailer.backends.DatabaseBackend"
- Sync Backend: Send emails synchronously. Does not provide the reliability that the database backend provides, but still provides the logging and throttling features.
EMAIL_BACKEND = "django_nitro_mailer.backends.SyncBackend"
The emails are delivered using the backend from the NITRO_EMAIL_BACKEND setting (SMTP by default).
Django 6.1+ MAILERS
With Django 6.1 MAILERS, use a django-nitro-mailer backend as the default mailer and point NITRO_EMAIL_MAILER at a separate mailer alias that does the actual delivery:
import os
MAILERS = {
"default": {"BACKEND": "django_nitro_mailer.backends.DatabaseBackend"}, # or SyncBackend
"smtp": {
"BACKEND": "django.core.mail.backends.smtp.EmailBackend",
"OPTIONS": {
"host": "smtp.example.com",
"port": 587,
"username": os.environ["EMAIL_HOST_USER"],
"password": os.environ["EMAIL_HOST_PASSWORD"],
"use_tls": True,
},
},
}
NITRO_EMAIL_MAILER = "smtp"
NITRO_EMAIL_MAILER takes precedence over NITRO_EMAIL_BACKEND and must not point to a django-nitro-mailer backend. When MAILERS is configured, one of the two settings is required. The django-nitro-mailer backends themselves take no OPTIONS.
Documentation
Documentation is available here.
License
django-nitro-mailer is under the terms of the MIT License, following all clarifications stated in the license file.
Metadata
Release files for django-nitro-mailer 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_nitro_mailer-0.3.1.tar.gz | 18.2 kB | Without provenance | Details for django_nitro_mailer-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_nitro_mailer-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for django_nitro_mailer-0.3.1-py3-none-any.whl |
Total release size: 36.1 kB
Release files / django_nitro_mailer-0.3.1.tar.gz
| Download URL | django_nitro_mailer-0.3.1.tar.gz |
|---|---|
| Size | 18.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dfe00a238663cd9fc1e8bf504601e4f3d31d554b549ef7edd16175feb1786530
|
|
BLAKE2b-256 checksum How to use checksums |
715968b2bf7ab6e5d5ebec49d36079627cb27335a1adac7a8d34e092ca0ef248
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / django_nitro_mailer-0.3.1-py3-none-any.whl
| Download URL | django_nitro_mailer-0.3.1-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34e45c4c799b58ce006f5ad9909c8d42492af55f4a2ff522c2c8d58acc6f401f
|
|
BLAKE2b-256 checksum How to use checksums |
01bef8fbd0fda694155d2d1a7a69664e6007a4b08e8283da2881f127fb66a37a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for django-nitro-mailer 0.3.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.