problems with POST

1 view
Skip to first unread message

Vladimir

unread,
Feb 23, 2006, 3:49:14 PM2/23/06
to Django users
Hi guys,

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

Amit Upadhyay

unread,
Feb 23, 2006, 3:51:42 PM2/23/06
to django...@googlegroups.com
On 2/24/06, Vladimir <vladimir....@gmail.com> wrote:

<form action="/accounts/signIn" method="POST">

Hi,

This is a very common newbie mistake, make that action="/accounts/signIn/".

--
Amit Upadhyay
Blog: http://www.rootshell.be/~upadhyay
+91-9867-359-701

Vladimir

unread,
Feb 23, 2006, 3:59:20 PM2/23/06
to Django users
Oh, oops. Thanks for being patient with me. :-)

Happy Django user

Reply all
Reply to author
Forward
0 new messages