Code

Opened 8 years ago

Closed 8 years ago

#2083 closed defect (wontfix)

Why is the username field in "django/contrib/auth/models.py" restricted?

Reported by: djangoproject.com@… Owned by: adrian
Component: Contrib apps Version: master
Severity: minor Keywords: username auth
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Why is the username field for a user in django restricted to: 30 chars, alphanumeric?

It is more use to everybody who wants to be "more open" with his site when the username can be (nearly) anything. Let the site-creator decide (using his own validators) how the username should look like for his site.

So:

username = models.CharField(_('username'), maxlength=30, unique=True, validator_list=[validators.isAlphaNumeric])

should be changed to something like:

username = models.CharField(_('username'), maxlength=255, unique=True)

Regards, Alex

Attachments (0)

Change History (2)

comment:1 Changed 8 years ago by adrian

  • Component changed from Core framework to Contrib apps
  • priority changed from normal to low
  • Severity changed from normal to minor

It's restricted like that because that's how we liked to validate our usernames at World Online.

comment:2 Changed 8 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed

If you don't like this behavior, you can use a custom auth backend. See the new docs.

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.