On Tue, Sep 20, 2011 at 11:46 AM, Fabio Natali <[email protected]> wrote:
> Hi everybody!
>
> I have a very simple view which is supposed to print out GET or POST,
> depending which has been used to send data. The problem is I always get
> "GET" even when sending data via POST.
>
> ### views.py:
> def method(request):
>    return HttpResponse(request.method)
>
> ### urls.py:
> (r'^method/$', method)
>
> ### php script to send data to the Django page:
> <form method="post" action="http://192.168.0.2:8000/method/";>
>  <input type="text" id="firstname">
>  <input type="submit" value="Send">
> </form>
>
> I am running Django version 1.2.5, development server.
>
> Am I missing something? Any hint?
>
> Thanks, Fabio.
>
> --
> Fabio Natali FNstudio

I'm not 100% sure, but since you aren't including the
csrfmiddlewaretoken in the post data, I would expect it to 403 if you
aren't exempting the view from CSRF protection [1].

[1] https://docs.djangoproject.com/en/1.3/ref/contrib/csrf/

-- 
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.

Reply via email to