Opened 12 years ago
Closed 12 years ago
#20426 closed Cleanup/optimization (fixed)
note about the AuthenticationForm API
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.5 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | yes |
Description
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 ;)
Change History (2)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Something as simple as:
would probably suffice.