Created
May 29, 2012 20:49
-
-
Save vojd/2830622 to your computer and use it in GitHub Desktop.
Django contact form view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.views.generic.edit import ProcessFormView | |
class ContactView(ProcessFormView): | |
form_class = ContactForm | |
template_name = 'contact.html' | |
success_url = '/thanks/' | |
def form_valid(self, form): | |
send_contact_message(form.cleaned_data['email'], | |
form.cleaned_data['message']) | |
return super(ContactView, self).form_valid(form) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment