[英]Email verification and password reset - django rest framework and angularjs
How do I implement the built in views for password-reset in the django.rest.auth and how do I create an email verification system for registration using the django rest framework and angularjs?如何在 django.rest.auth 中实现用于密码重置的内置视图,以及如何使用 django rest 框架和 angularjs 创建用于注册的电子邮件验证系统?
I have been searching for a tutorial or some good documentation that on how to implement django's send_email function in a website using the django rest framework and angular js but I haven't been able to find any.我一直在寻找有关如何使用 django rest 框架和 angular js 在网站中实现 django 的 send_email 功能的教程或一些好的文档,但我一直找不到。
What I need...我需要什么...
What I have...我有什么...
in settings.py i have added this...在settings.py中我添加了这个...
EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = 'myemail@gmail.com' EMAIL_HOST_PASSWORD = 'mypassword' EMAIL_PORT = 587
in my urls.py i have added this...在我的 urls.py 中,我添加了这个...
from django.conf.urls import url from rest_auth.views import PasswordResetView, PasswordResetConfirmView urlpatterns = [ url(r'^password/reset/$', PasswordResetView.as_view(), name='password_reset'), url(r'^password/reset/confirm/$', PasswordResetConfirmView.as_view(), name='password_reset_confirm'), ]
So my question is how do I implement these views and urls to my project and how to I create email confirmation using the from django.core.mail import send_mail
所以我的问题是如何在我的项目中实现这些视图和 url,以及如何使用
from django.core.mail import send_mail
创建电子邮件确认
Thanks in advance提前致谢
After the user fills the registration form you could ask for a verification code.用户填写注册表后,您可以要求提供验证码。 This verification code will be sent to the email address provided in the registration form.
此验证码将发送到注册表中提供的电子邮件地址。 On correctly entering the verification code you can set the users to active.
正确输入验证码后,您可以将用户设置为活动状态。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.