django-sendgrid-v5
An implementation of Django's EmailBackend compatible with sendgrid-python v5+
What it is and what it does
django-sendgrid-v5 replaces Django's default SMTP email backend with one that routes all outgoing mail through SendGrid's REST API. Instead of configuring SMTP credentials, you set a SendGrid API key and point Django's EMAIL_BACKEND setting to the package's SendgridBackend class. It works with Django's standard send_mail() and EmailMessage classes, so existing code requires minimal changes.
The package extends Django's email system with SendGrid-specific features: dynamic template support with JSON data injection, email open and click tracking, unsubscribe group management, custom personalization arguments, scheduled send times, and IP pool selection. It also includes webhook helpers to cryptographically verify and process delivery events (bounces, opens, clicks) from SendGrid's event webhook, useful for tracking email status in your application's database.
Use it for:
- Replace SMTP with SendGrid's REST API for more reliable email delivery in production Django applications.
- Use SendGrid dynamic templates with personalized JSON data to send complex, branded emails from Django.
- Track email opens and clicks by enabling SendGrid's tracking features through simple configuration flags.
- Implement webhook handlers to log email delivery events (delivered, bounced, blocked) to your application database.
- Send emails in sandbox mode during development or testing to avoid accidentally sending real messages.
- Support multi-region deployments by switching SendGrid API endpoints (e.g., EU region) via configuration.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a Django email backend that sends messages through SendGrid's REST API instead of SMTP, with support for dynamic templates, tracking, and webhook signature verification.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It is well-suited for Django projects that already use or plan to adopt SendGrid for email delivery, offering both standard Django email functionality and SendGrid-specific features like dynamic templates and webhook event processing.
Install
django-sendgrid-v5 on PyPI
pip
pip install django-sendgrid-v5uv
uv add django-sendgrid-v5poetry
poetry add django-sendgrid-v5Installing django-sendgrid-v5
Before you install
Low friction installation with three straightforward dependencies (django, python-http-client, sendgrid). The package is actively maintained with recent commits and no known vulnerabilities.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install django-sendgrid-v5
# In Django settings.py:
EMAIL_BACKEND = "sendgrid_backend.SendgridBackend"
SENDGRID_API_KEY = os.environ["SENDGRID_API_KEY"]
# Then use Django's standard email API:
from django.core.mail import send_mail
send_mail('Subject', 'Message', 'from@example.com', ['to@example.com'])
Requires a SendGrid account and API key; set SENDGRID_API_KEY environment variable before use.
Verify before relying
- Whether webhook signature verification works with all SendGrid event types beyond the documented examples.
- Performance characteristics when sending bulk emails or handling high-frequency webhook events.
- Compatibility with Django versions not explicitly listed in classifiers (3.2, 4.0, 4.1, 4.2, 5.0).
Package facts
| License | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,… (full text in the JSON record) (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — django, python-http-client, sendgrid |
| Maintenance | actively maintained — 221 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 483,757/month — #6,410 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_sendgrid_v5-1.3.1-py3-none-any.whl
Keywords: backend, django, email, sendgrid
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
sendgridSends emails and SMS messages via the Twilio…
permissive · top 1,000 on PyPI
smtpapiBuilds SendGrid SMTP API headers for use in…
permissive · top 15,000 on PyPI
django-anymailSends and receives email in Django through…
permissive · top 5,000 on PyPI
django-post_officeDjango Post Office queues and sends emails…
permissive · top 15,000 on PyPI
apache-airflow-providers-sendgridIntegrates SendGrid email delivery into Apache…
permissive · top 15,000 on PyPI
django-sesA Django email backend that routes outgoing…
permissive · top 5,000 on PyPI
django-naomidjango-naomi is a Django email backend that…
permissive · top 15,000 on PyPI
postmarkerPostmarker is a Python client library for the…
permissive · top 5,000 on PyPI
sparkpostOfficial Python client for the SparkPost email…
permissive · top 15,000 on PyPI
python-http-clientProvides a simplified Python interface for…
permissive · top 1,000 on PyPI