note about the AuthenticationForm API
|Reported by:||joel.hansson@…||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The django.contrib.auth.forms.AuthenticationForm needs two arguments passed when creating the object in the view.
form = AuthenticationForm(request, request.POST)
I was unable to find this in the documentation anywhere.
Since I didn't know this, I thought it would take the same arguments as documented at https://docs.djangoproject.com/en/1.5/topics/forms/#using-a-form-in-a-view
I initially tried that, but there was no exception raised, nothing in form.errors. However form.is_valid() still returned False.
Discovered the solution by joining #django @ freenode and was pointed to the actual source code which explained the issue.
A Note about this in the docs would have saved me an hour of hair-tearing ;)