I am new to Django, but I really like what I saw so far. Cool stuff.
I am running 0.91 and having trouble with POST request. If I change the
method from POST to GET the things works, so I was wondering what's
going on.
Template:
<form action="/accounts/signIn" method="POST">
<input type="text" name="userName"/>
<input type="password" name="password"/>
<input type="submit" value="Sign in"/>
</form>
View:
def signIn(request):
try:
user = users.get_object(username__exact=request['userName'])
...
except users.UserDoesNotExist:
...
Problem:
KeyError at /accounts/signIn/
'userName not found in either POST or GET
...
GET No GET data
POST No POST data
As I said, if I change POST to GET, the thing works suddenly.
Any ideas?
Many thanks,
Vladimir
<form action="/accounts/signIn" method="POST">
Happy Django user