Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#16709 closed Uncategorized (wontfix)

Allow username to be longer than 30 characters to use e-mailaddresses as username

Reported by: wim@… Owned by: nobody
Component: contrib.auth Version: 1.3
Severity: Normal Keywords:
Cc: frankoid Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Some email addresses are longer than 30 characters. It is not possible to use those as a username, except by monkey patching / overwriting django's default User model.

I would like to set the constraint less strict and allow for usernames to be up to 128 characters for example, like the password.

Attachments (2)

patch_for_ticket16123.diff (1.9 KB) - added by wim@… 4 years ago.
patch for 128-char usernames
username_of_128chars.diff (2.7 KB) - added by wim@… 4 years ago.
patch for making usernames 128 characters

Download all attachments as: .zip

Change History (8)

Changed 4 years ago by wim@…

patch for 128-char usernames

Changed 4 years ago by wim@…

patch for making usernames 128 characters

comment:1 Changed 4 years ago by wim@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Obviously I added the wrong patch, please use the second one.

comment:2 Changed 4 years ago by aaugustin

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

This is a duplicate of #7591, see comment number 4 for a solution.

A Google search for "site:code.djangoproject.com email as username" turns up several tickets related to this controversial topic.

comment:3 Changed 4 years ago by wim@…

  • Resolution duplicate deleted
  • Status changed from closed to reopened

Hi Aymeric Augustin,

Thanks for looking into the ticket. I've seen a lot of different custom EmailBackEnds on google today, actually that's why I think we need one in Django, because there is a demand. Django claims to encourage rapid development, I believe it should have this option. Allowing logging in using a username and not using an e-mail seems like an arbitrary decision to me, not a well-argumented one.

For me implementing nr. 4 is not a proper solution, several problems are outlined here:
http://groups.google.com/group/django-developers/browse_thread/thread/61c15301a89d88be. Moreover, the argument being used ("it is easy to do it yourself") sounds similar to the argument against truncatechars.

My belief is that it might be a very easy change to allow for longer usernames. I'm wondering what are the reasons against it?

I am reopening this ticket, though I'm not sure if it's the right way to do things, I'm sorry if I am mistaken. Again, thanks for your time looking into this!

comment:4 Changed 4 years ago by aaugustin

I see that you've started a discussion thread on django-developers. This is a good idea for two reasons:

  • Jacob Kaplan-Moss issued a "wontfix" on this idea in #7591, and the canonical way to reverse a "wontfix" by a core developer is to obtain a consensus on the mailing list;
  • there's no obvious way to implement username as login — as you say, many people have attempted to resolve this problem in different ways, with more or less convincing results.

Let's keep this ticket as "unreviewed" for now, we'll see in a few days where the discussion goes.

For the record, and for what my opinion is worth, I think that this issue won't be solved until someone spends a few months (full-time) to write the next version of django.contrib.auth, typically in the context of a GSoC: https://code.djangoproject.com/wiki/SummerOfCode2011#Enhancedauth.user — which is covered by #3011.

Last edited 4 years ago by aaugustin (previous) (diff)

comment:5 Changed 4 years ago by russellm

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

No, let's not keep this as unreviewed. It ain't gonna happen like this.

There is a very good reason that this proposal keeps getting rejected, and that reason hasn't changed - we dont have a way to manage the data migration. We simply *cannot* change the length of the username field because we can't change the existing databases of almost every Django install in existence.

The core-endorsed ticket for this problem is #3011. The patch on that ticket isn't endorsed, but it points at the real problem - a need to be able to specify a custom User model. There have been several discussions directed at this problem, and I'm hoping to get a posse discussing this at the upcoming DjangoCon sprints. If you want background on some approaches that might work (and some that won't) search the archives for Lazy Foreign Key.

comment:6 Changed 3 years ago by frankoid

  • Cc frankoid added
Note: See TracTickets for help on using tickets.
Back to Top