Empty Request.post After Upgrade To Django 1.3
Solution 1:
I had a similar problem (empty request.POST) with django 1.3, but it was due to a bug in my HTML.
I had a form with action="foo"
but my urls.py mapped "foo/" to the view (where I was expecting some POST data, and getting none). Django kindly server-side redirects requests for "foo" to "foo/", but the POST data was not being resubmitted to "foo/" as part of the deal. In hindsight that seems quite sensible. Changing my form (to action="foo/"
) fixed it, I suppose changing the urls.py could have worked too.
Solution 2:
I recall having a problem of this kind, it turned out that accessing request.raw_post_data
prevented the request.POST
dict from being subsequently populated with the post params. What happens if you remove the logging.debug line?
Solution 3:
Also check your content type header.
Eg.
'CONTENT_TYPE': 'application/x-www-form-urlencoded'
Earlier versions were more accommodating if this header was missing or invalid.
Post a Comment for "Empty Request.post After Upgrade To Django 1.3"