Can anyone explain me how to make send email form on page.

So my forms.py
class ContactForm(forms.Form): 
    name = forms.CharField(required=True)
    last_name = forms.CharField()
    adults = forms.IntegerField() children = forms.IntegerField() 
    email = forms.EmailField(required=True)
    message = forms.CharField(widget=forms.Textarea) 

views.py
class TourDetailView(DetailView):
    model = models.Tour 
    template_name = 'tours/tour-detail.html' 
    form_class = forms.ContactForm
    success_url = 'tours.html' 

As far as i understand i need to get data from request , but i dont know 
how to do it. There are a lot of information in function based views, but i 
didnt get how to do it in class based views.

And it would be nice of you to explain where should i put send_mail 
function. Any help will be appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/18a42d87-5c8a-46d6-b0ae-01ef8575eb96n%40googlegroups.com.

Reply via email to