Django - 认证,电子邮件确认注册 [英] Django - authentication, registration with email confirmation

查看:139
本文介绍了Django - 认证,电子邮件确认注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看API进行身份验证



https://docs.djangoproject.com/en/1.3/topics/auth/



我似乎无法找到有关简单用户的信息注册表单将按照通常的方式在网站上发送确认电子邮件。



我想我可以这样做:



1)显示一个表单
2)用户输入信息并提交
3)将用户保存为非活动状态,确认码为
4)发送确认码链接
5)用户单击确认链接并变为活动状态



这似乎并不困难,但我有一种感觉,这可能已经完成了,而且还有很多很少需要考虑的边缘案例。

解决方案

这不是Django内置的。有一个名为 django-allauth 的可重用应用程序,可满足您的需要。



以前是 django-registration 的应用程序推荐,但现在不保养和过期。



编辑笔记:截至2016年12月,django注册不会保留。 p>

I'm looking at the API for authentication

https://docs.djangoproject.com/en/1.3/topics/auth/

I can't seem to find information on simple user registration form that would send confirmation email as it is the usual way on web sites.

I guess I could do this:

1) Display a form 2) User enters info and submits 3) Save user as inactive, with a confirmation code 4) Send a link with confirmation code 5) User clicks a confirmation link and becomes active

It doesn't seem that difficult but I have a feeling this might be done already, and also there are quite a few edge cases that would need to be considered.

解决方案

It's not built into Django. There is a reusable app called django-allauth, which will fit your needs.

An app called django-registration used to be recommended, but that is now unmaintained and out of date.

Editor note: django-registration is not unmaintained as of December 2016.

这篇关于Django - 认证,电子邮件确认注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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