On Feb 9, 10:46 am, harryos <[email protected]> wrote:
> I was trying to create login in my application.
And there's a flaw in your view's flow (ok lame pun, sorry).
Your function's flow is:
if request.method=='POST':
try to authenticate the user
if it succeeds:
return a "redirect" response
# XXX AND IF IT FAILS ????
else:
return a response displaying the login form
> when I give a wrong username password combination ,I get this error
> ValueError,.views.login_view didn't return an HttpResponse object.
Indeed. See the big "XXX" above ? You need to handle the case when the
authentication fails.
HTH
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.