The goal of the contact page is to enable users to give us feedback on our site. To that end, we want to present users with a form that allows them to write feedback and gives us a way to contact them in the event they want us to. Without a model, we need to build the form as a
Form (Example 11.5) instead of as a
ModelForm as we did previously.
1 from django import forms . ... 6 class ContactForm(forms.Form): . ... 18 email = forms.EmailField( 19 email@example.com') 20 text = forms.CharField(widget=forms.Textarea)
By default, a
forms.CharField (as opposed to
models.CharField) presents ...