Let's start from the simplest possible example - we will allow user to add email to some newsletter. Here is tho code for model, url and form :
class NewsletterForm(forms.Form): email = forms.EmailField(label=_("E-mail address")) class NewsletterEmails(models.Model): email = models.EmailField(_(u"E-mail address"),) urlpatterns = patterns('', url(r'^newsletter_add/$', newsletter_add, name="newsletter_add"), )
Nothing unexpected here I guess. Simple model, simple form with just one field and a link to our view (remember - even though we're not redirecting user to this link, we still need a way to call our view function processing the email).
Next comes the view function :
Now the form. This is really basic so I won't say anything more about it apart of the fact that we explicitly set the action of our form to address of view processing addition of emails :
For the first time I have prepared a working example under this link :
as well as downloadable code :
If you have any questions feel free to ask in comments or on my twitter.