fork download
  1. def contact(request):
  2. form = ContactForm()
  3. if request.POST:
  4. form = ContactForm(request.POST)
  5. if form.is_valid():
  6. cd = form.cleaned_data
  7. send_mail(
  8. cd['subject'],
  9. cd['message'],
  10. cd.get('email', 'noreply@example.com'),
  11. ['my@mail.ru'],
  12. )
  13. return HttpResponseRedirect('/')
  14. else:
  15. form = ContactForm()
  16. return render_to_response('contact.html', {'form': form}, context_instance=RequestContext(request))
Success #stdin #stdout 0.02s 8696KB
stdin
Standard input is empty
stdout
Standard output is empty