skillfed

django-sendgrid-v5

An implementation of Django's EmailBackend compatible with sendgrid-python v5+

django-sendgrid-v5 v1.3.1 483.8K downloads/30d#6,410 on PyPI346
Permissive 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) Active released

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-v5

uv

uv add django-sendgrid-v5

poetry

poetry add django-sendgrid-v5

Installing 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

Framework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

django sendgrid email backendsendgrid rest api djangodjango email delivery sendgridsendgrid dynamic templates djangodjango smtp alternative sendgridsendgrid webhook verification djangodjango email tracking sendgrid
django-integrationemail-deliverysendgrid-api

More Dynamic Content packages