django-sendgrid is the easiest way to send e-mail with SendGrid. It uses the SendGrid SMTP API, as recommended.
Although it’s rather simple to use, a example project is included to demonstrate usage.
Installation
To install with PyPi:
pip install django-sendgrid
Usage
Add sendgrid to your INSTALLED_APPS:
INSTALLED_APPS = (
# Existing apps
"sendgrid",
)
Add the following to your settings:
SENDGRID_EMAIL_HOST = "smtp.sendgrid.net" SENDGRID_EMAIL_PORT = 587 SENDGRID_EMAIL_USERNAME = "your_sendgrid_username" SENDGRID_EMAIL_PASSWORD = "your_sendgrid_password"
The API is similar to that of Django’s; create a SendGridEmailMessage and send it:
>>> from sendgrid.message import SendGridEmailMessage
>>> email = SendGridEmailMessage('Subject', 'Body', 'ryan@ryanbalfanz.net', ['ryan@ryanbalfanz.net'])
>>> email.send()
Additional Information
Metadata
Release files for django-sendgrid 1.0.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 | |
|---|---|---|---|---|
| django-sendgrid-1.0.1.tar.gz | 21.7 kB | Without provenance | Details |
Release files / django-sendgrid-1.0.1.tar.gz
| Download URL | django-sendgrid-1.0.1.tar.gz |
|---|---|
| Size | 21.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c0484747a797c4e033639807b91267776cf9cea9cfc71648db33cc3fd0e67f0
|
|
BLAKE2b-256 checksum How to use checksums |
3e939870159aa924360b02b427b1b501c3861723175645baaef005e5b00dc43c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-sendgrid 1.0.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.