Skip to main content

django-sendgrid

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-sendgrid-0.4.2.tar.gz (11.6 kB view details)

Uploaded Source

File details

Details for the file django-sendgrid-0.4.2.tar.gz.

File metadata

File hashes

Hashes for django-sendgrid-0.4.2.tar.gz
Algorithm Hash digest
SHA256 d63063ec8d519d35d1e716bdd4ac91e4e4e876aa74c34c47a155993e5898277a
MD5 0df8bdb53ff65a2ebe8e6e59782adfe6
BLAKE2b-256 21e595b9a7bde6ac3ddde52f55486793689c89e5f3847dac1e26c7c4c647553d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page