It was like You said, now I see form and when I write password and submit I have
W dniu wtorek, 7 października 2014 21:21:16 UTC+2 użytkownik Collin Anderson napisał:
-- KeyError at /password_change/
'username'
Request Method: POST Request URL: http://darmys.pythonanywhere.com/password_change/ Django Version: 1.6.5 Exception Type: KeyError Exception Value: 'username'Exception Location: /home/darmys/dom/dom/views.py in password_change_dom, line 55
W dniu wtorek, 7 października 2014 21:21:16 UTC+2 użytkownik Collin Anderson napisał:
also, I highly recommend the render() shortcut:def password_change_dom(request):
if request.method == 'POST':
form = FormularzPasswordChange(request .POST)
if form.is_valid():
user = authenticate(username=form.cleaned_data ['username'])
user.set_password(form.cleaned_data ['password2'])
user.save()
login(request, user)
return HttpResponseRedirect("/")
else:
form = FormularzPasswordChange()
return render(request, 'registration/change_password.html' , {'form': form})
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7a5e519f-61f2-49c3-83e8-fdc2a3c663dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment