In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Flask blog how to reset the password by sending e-mail, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
Today, let's move on to the previous Flask_Blog project about the ability to reset passwords by sending emails when registered users forget their passwords. Let's start with: modify Flask_Blog\ flaskblog\ models.py, modify the User class, add methods for obtaining token tokens and verifying tokens:
Modify Flask_Blog\ flaskblog\ _ _ init__.py to add mail-related variable parameters:
Modify Flask_Blog\ flaskblog\ forms.py, add the reset password form, and send the mail form:
Modify Flask_Blog\ flaskblog\ models.py, add a definition to send email reset password method, reset password method, reset token method:
Modify Flask_Blog\ flaskblog\ templates\ login.html and click to forget your password to jump to the connection:
Create a new file in Flask_Blog\ flaskblog\ templates
Reset_request.html:
Create a new file in Flask_Blog\ flaskblog\ templates
Reset_token.html:
Because flask-mail is used, you need to install:
Then we open the command line cmd in the folder Flask_Blog, run python run.py, visit http://127.0.0.1:5000/, and click login navigation:
Click to forget your password? After entering the mailbox, click the reset password button to submit:
When successful, you will be prompted that the message has been sent to the mailbox:
At this time, when we log in to the mailbox filled in to retrieve the password, we will find that we have received an email to reset the password:
Click the reset password connection in the email, enter the new password and confirm the password submission:
Indicates that the password has been modified successfully:
After reading the above, have you mastered how the Flask blog resets passwords by sending emails? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.