I see a couple of issues:
def UserResetPassword(request):
form = UserForgotPasswordForm(request.POST or None) #data=is request.POST or None
if request.method == 'POST':
if form.is_valid():
form.save(from_email = 'admin@thedomain.com', email_template_name= 'mysite/reuse/forgotpassword.html', use_https = False, token_generator = default_token_generator, html_email_template_name=None)
return render(request, 'mysite/reuse/forgotpassword.html', {
'form':form
})
Also, get rid of the else
part. You want to be able to see what the error is. render()
would show the errors.
In the forms,
fields = ("email")
should be
fields = ("email", )
Also, you should be using PasswordChangeForm
if you want a form that lets a user change his/her password by entering their old password.