接受电子邮件地址作为在Django用户名 [英] Accepting email address as username in Django

查看:141
本文介绍了接受电子邮件地址作为在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆