xxxxxxxxxx
if form.is_valid():
review=Review(username=form.cleaned_data["username"],
review_text=form.cleaned_data["review_text"],
rating=form.cleaned_data["rating"])
review.save()
return HttpResponseRedirect("thank-you/")
xxxxxxxxxx
from django.core.mail import send_mail
if form.is_valid():
subject = form.cleaned_data['subject']
message = form.cleaned_data['message']
sender = form.cleaned_data['sender']
cc_myself = form.cleaned_data['cc_myself']
recipients = ['info@example.com']
if cc_myself:
recipients.append(sender)
send_mail(subject, message, sender, recipients)
return HttpResponseRedirect('/thanks/')