Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
How to write a simple password changer?

Hi,

can you please explain how to create a password changer? After providing first password to the user, user should be able to change their fist password with their preference. So I created the code below. Could you please provide the necessary part?

@app.route("/changepassword",methods=['GET','POST'])
@loginrequired
def userchangepassword():
form=ChangePasswordForm()
if form.validateonsubmit():
#They should enter their first password
#New password
#New password again
return rendertemplate('/passwordchange.html',form=form)


EDIT: Please check my new comment below. I updated the code.

/r/flask
https://redd.it/10isg81