Hi, i've created a contact fom based on the one in the docs but i
don't know what to put as the action in the form element as part of
template. I've got this template:
<form action="contact_me" method="POST">
{{ form.as_p }}
<input type="submit" value="Submit" />
</form>
but presuambly the data is being handled by the view. I'd appreciate
any help, i tried it without an action and i got a 'Exception Value:
(10061, 'Connection refused') ' error.
Could someone please help?
Thanks
I've included a copy of the view below
------------------------------------------------------------------------------------------------------------------------------------------------
def contact_me(request):
if request.method == 'POST':
form = ContactForm(request.POST)
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 = ['[email protected]']
if cc_myself:
recipients.append(sender)
from django.core.mail import send_mail
send_mail(subject, message, sender, recipients)
return HttpResponseRedirect('/thanks/')
else:
form = ContactForm()
return render_to_response('blogSite/contact_me.html', {'form':
form, })
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---