Code

Opened 5 years ago

Closed 5 years ago

#11389 closed (duplicate)

contrib.auth.login should allow to replace AuthenticationForm

Reported by: anonymous Owned by: nobody
Component: contrib.auth Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Hello,

I'm using django for quite some time. For the first time I needed a custom login (other fields besides login and password) and also a custom auth backend.

I had to do a custom login with is basically a copy of contrib.auth.views.login with AuthenticationForm replaced by my own form.

The definition of contrib.auth.views.login should be:
def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME, authentication_form=AuthenticationForm):

so we could just define on urls.py with form class we would like to use.

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

This ticket is a dulicate.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.