
编写password_change_form.html

编写password_change_done.html

配置account下的urls.py文件

实现没登陆的情况下访问其他页面。自动跳转到登录页面
首先在mysite/setting.py中配置这样一行,

然后修改login2_html中的登录模块

增加修改密码的按钮

重置密码功能

在account/urls.py下加一个重制的路由

编写一个password_reset_form.html

编写一个password_reset_email.html

编写一个password_reset_subject.txt

account/urls.py下增加password_reset_done 的路由

然后编写password_reset_done.html

配置用户邮件内的路由,在account/urls.py下配置

编写password_reset_confirm.html

配置password-reset-complete的路由,在account/urls.py下配置

配置password_reset_complete.html

配置mysite/setting.py文件,添加一行代码,用于发邮件测试,在控制台中可以输出邮件内容

将重置密码位置放在登录界面

正式环境邮箱配置,在mysite/setting.py下配置

需要在邮箱开通SMTP服务,就可以发邮件了。