接受电子邮件地址作为在Django用户名 [英] Accepting email address as username in Django
问题描述
有没有做到这一点在Django没有我自己的滚动认证系统的好办法?我想要的用户名是用户的电子邮件地址,而不是他们创建一个用户名。
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.
请指教,谢谢。
推荐答案
有关谁都想做到这一点,我建议采取一看的 Django的电子邮件作为户名这是一个pretty COM prehensive解决方案,它包括修补管理员和 createsuperuser
管理命令,除其他零零碎碎。
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.
修改:由于Django的1.5起,你应该考虑使用的 Django的电子邮件作为户名定制用户>自定义用户模型。
Edit: As of Django 1.5 onwards you should consider using a custom user model instead of django-email-as-username.
这篇关于接受电子邮件地址作为在Django用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!