O'Reilly logo
  • Michael MacKinnon thinks this is interesting:

How to do it...

Execute these two steps:

  1. Import the function to send an e-mail in the forms of your app. Then add the save method that tries to send an e-mail to the selected recipient and fails silently with an error:
    # -*- coding: UTF-8 -*-
    from django import forms
    from django.utils.translation import ugettext, ugettext_lazy as _
    from django.core.mail import send_mail
    from django.c...


Cover of Web Development with Django Cookbook


Save method in form instead of view