A Django email backend for Amazon's Simple Email Service
Project description
- Info:
A Django email backend for Amazon’s Simple Email Service
A bird’s eye view
Django-SES is a drop-in mail backend for Django. Instead of sending emails through a traditional SMTP mail server, Django-SES routes email through Amazon Web Services’ excellent Simple Email Service (SES).
Why SES instead of SMTP?
Configuring, maintaining, and dealing with some complicated edge cases can be time-consuming. Sending emails with Django-SES might be attractive to you if:
You don’t want to maintain mail servers.
You are already deployed on EC2 (In-bound traffic to SES is free from EC2 instances).
You need to send a high volume of email.
You don’t want to have to worry about PTR records, Reverse DNS, email whitelist/blacklist services.
Django-SES is a truely drop-in replacement for the default mail backend. Your code should require no changes.
Getting going
Assuming you’ve got Django installed, you’ll need Boto 2.0b4 or higher. Boto is a Python library that wraps the AWS API.
You can do the following to install boto 2.0b4 (we’re using –upgrade here to make sure you get 2.0b4):
pip install --upgrade boto
Install django-ses:
pip install django-ses
Add the following to your settings.py:
EMAIL_BACKEND = 'django_ses.SESBackend' # These are optional -- if they're set as environment variables they won't # need to be set here as well AWS_ACCESS_KEY_ID = 'YOUR-ACCESS-KEY-ID' AWS_SECRET_ACCESS_KEY = 'YOUR-SECRET-ACCESS-KEY'
Now, when you use django.core.mail.send_mail, Simple Email Service will send the messages by default.
Check out the example directory for more information.
SES Stats Report
A very simple read-only report on your quota, verified email addresses and sending statistics is included.
If you wish to use the SES sending statistics reports, you must include django_ses in your INSTALLED_APPS and you must include django_ses.urls in your urls.py.
Django Builtin-in Error Emails
If you’d like Django’s Builtin Email Error Reporting to function properly (actually send working emails), you’ll have to explicitly set the SERVER_EMAIL setting to one of your SES-verified addresses. Otherwise, your error emails will all fail and you’ll be blissfully unaware of a problem.
Note: You will need to sign up for SES and verify any emails you’re going to use in the from_email argument to django.core.mail.send_email(). Boto has a verify_email_address() method: https://github.com/boto/boto/blob/master/boto/ses/connection.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-ses-0.1.tar.gz
.
File metadata
- Download URL: django-ses-0.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63b334654c17765dedc78478508f89bb4db8607a1bdea7c0951cdbc5395238ff |
|
MD5 | 5d4ca21a866a45913610f2f012d513ef |
|
BLAKE2b-256 | 462dca0a5218272626d7bdcd96d9b0096d2d2d9ed95d3cfc1a86354745d0b506 |
File details
Details for the file django_ses-0.1-py2.6.egg
.
File metadata
- Download URL: django_ses-0.1-py2.6.egg
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8030a68a3f48529efd24fd549386f519973d7d2e08ff705cf252568efcf0fa9 |
|
MD5 | 168ad2264cdace010754fa8eaa2b833d |
|
BLAKE2b-256 | d8fde245ac9ea7d439aa453ad214e65d8933764b2d4e32fa3b0ad20599671d77 |