I am trying to implement a forgotten password function in my django application. I gave a separate forgotten Password.html where the user can specify their email id; and if this email is registered (found in the database), the corresponding password for this email is exposed and sent to its email identifier. This is what I am trying to achieve. Being a newbie to Django, I am stuck in implementation. This is my forgetPassword.html
<form name="forgotPassword" method="POST" id="myFormid" action="http://10.1.0.90:8080/forgotPassword/"> <div style="float:center;width:100%;"> Enter your E-mail ID</label><br/> <input type="text" name="email" size="25" /> <input type="submit" value="Submit" /> </div> </form >
my method in views.py
def forgotPassword(request): if request.POST: email=request.POST.get("email") print email user = UniversityDetails.objects.filter(email=email) print user if(not user): print "No user" return render_to_response("forgotPassword.html") else: ??????????????? return render_to_response("passwordRecovery.html") return render_to_response('forgotPassword.html')
Here I am trying to pass the email id entered in forgetPassword.html and save it in the "email" variable. After that, you will receive all objects with this letter from the database. and filter the password. I guess the part where I put ???? must be filled out with a request for a password matching this email id. Can anyone help me do this.
source share