1👍
You shouldn’t be hashing the submitted password in the view. The backend does that for you when you call the User.check_password
method.
1👍
Change in your view
def login_backend(request):
if request.method == 'POST':
username = request.POST['username']
password = request.POST['password']
user = authenticate(username=username, password=password)
#password = hashlib.sha1(password).hexdigest()
#user = authenticate(username=username, password=password)
state = "Username or Password Incorrect!"
if user is not None:
login(request, user)
return HttpResponseRedirect('/overview/')
else:
return render_to_response('login_backend.html', {'state':state}, context_instance=RequestContext(request))
else:
return render_to_response('login_backend.html', context_instance=RequestContext(request))
- [Answered ]-What attributes are available on key in django boto amazon s3
- [Answered ]-PUT method not working in django-tastypie?
- [Answered ]-Database engine choice for Django/ Python application
Source:stackexchange.com