#10763 closed (duplicate)
Allow custom AuthenticationForm in django.contrib.auth login view.
Reported by: | Felipe 'chronos' Prenholato | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | 1.1-beta |
Severity: | Keywords: | login, forms, authentication, customization, custom | |
Cc: | bas@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The idea is: allow develop to set a custom authentication form in login view without change much code.
Support of custom forms is usefull if developer use a custom form class, if plan to make more things in authentication that default form does (if for some motive he not want to write your own view) and, after all, form is better place to validate trought e-mail instead username (a common request I think).
This patch allow develop to send own authentication form to login view in urls.py and do what he wants in form.
I attach patch, a urls.py snippet and a form that I used to show example. My form use <a href="https://launchpad.net/django-form-utils">django-form-utils</a> in case to allow more customizable forms.
Attachments (3)
Change History (6)
by , 16 years ago
Attachment: | login_custom_form.diff added |
---|
by , 16 years ago
Attachment: | login_custom_form-forms.py added |
---|
The form in forms.py that I using, basically a copy of AuthenticationForm
comment:2 by , 14 years ago
Cc: | added |
---|
The patch in views.py