Accepting email address as username in Django

后端 未结 12 2067
感动是毒
感动是毒 2020-11-28 19:48

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 userna

12条回答
  •  臣服心动
    2020-11-28 20:29

    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.

提交回复
热议问题