2 Blog Entries tagged: email


Testing Emails with Django

  • November 20th, 2008 (1 year, 8 months ago)

Django ticket #8638 titled, "Provide setting to disable e-mail sending", caught my eye as an interesting item to look into. As I looked into it, however, I came up with a pretty simple way to set up testing that involves some settings.py changes and about 4 lines of Python code.

The big piece of magic comes from Python's built-in smtpd library and the smtpd.DebuggingServer class, which discards all e-mails sent to it and prints them to stdout.

Let's use the class to create a local mail server that will discard and print all emails sent to ...

Read the rest »

About this entry

Date Posted:
November 20th 2008 at 9:11:42 PM

Tagged:
debug, django, email, testing


Using Gmail's SMTP server from Django

  • August 31st, 2008 (1 year, 11 months ago)

Ever since changeset 5144 Django has had the ability to send email directly through Gmail with a few extra settings in your settings.py file. I recently set up a server using Ubuntu and had no intention of receiving email on it, but I did, however, want my website to be able to send email, so this is a great solution for that case.

Gmail

Consider creating a new email account from which the email will be sent. I like to do this for a few reasons:

  1. For security reasons I don't want to list my password of my ...

Read the rest »

About this entry

Date Posted:
August 31st 2008 at 11:08:28 PM

Tagged:
django, email, gmail