6π
β
If I remember correctly, the error you are getting happens because you got the signature of formβs initializer wrong: the first argument to it is βdataβ, which in your case resides in request.POST (and not the request itself), if you are arriving on a POST that is.
Commonly a view with a form will look something like this:
def my_view(request, ...):
if request.method == 'POST': # The form has been submitted
form = MyForm(request.POST)
if form.is_valid():
# do whatever you want here, save the form, etc
else:
form = MyForm()
return render_to_response('myform.html', ... )
π€shylent
Source:stackexchange.com