Accepting email address as username in Django

damon picture damon · Apr 22, 2009 · Viewed 43.7k times · Source

Is there a good way to do this in django without rolling my own authentication system? I want the username to be the user's email address instead of them creating a username.

Please advise, thank you.

Answer

Tom Christie picture Tom Christie · Feb 3, 2012

For anyone else wanting to do this, I'd recommend taking a look at django-email-as-username which is a pretty comprehensive solution, that includes patching up the admin and the createsuperuser management commands, amongst other bits and pieces.

Edit: As of Django 1.5 onwards you should consider using a custom user model instead of django-email-as-username.