Can django's auth_user.username be varchar(75)?

Posted by perrierism on Stack Overflow See other posts from Stack Overflow or by perrierism
Published on 2010-04-09T18:57:38Z Indexed on 2010/04/09 19:13 UTC
Read the original article Hit count: 494

Django's auth_user.username field is 30 characters. That means you can't have auth_user.username store an email address. If you want to have users authenticate based on their email address it would seem you have to do some wonky stuff like writing your own authentication backend which authenticates based on (email, password) instead of (username, password) and furthermore, figuring out what you're going to put in the username field since it is required and it is a primary key. Do you put a hash in there, do you try to put the id in there... bleh! Why should you have to write all this code and consider edge cases simply because username is too small for your (farily common) purposes? Is there anything wrong with running alter table on auth_user to make username be varchar(75) so it can fit an email? What does that break if anything?

© Stack Overflow or respective owner

Related posts about django

Related posts about django-models