Opened 11 years ago

Closed 11 years ago

#4070 defect closed duplicate (duplicate)

WSGI module failing with POST parameters

Reported by: sergio.berna Owned by:
Priority: normal Milestone:
Component: web Keywords: wsgi django post parameters
Cc: Branch:


After combining django and twisted using the twisted.web.wsgi module I wasn't able to retrieve any POST parameter passed from the browser.

After some debugging I got to the twisted.wsgi._WSGIResponse there the "wsgi.input" parameter was initialized to a cStringIO object which was positioned to the end of the stream, and thus any call to the read method returned an empty string. That effectively prevented django or any other framework to extract the content of the stream and parse the POST parameters.

I have added a workaround consisting on performing a to rewind the cStringIO object and allow the django request to correctly retrieve the post parameters.

+++ /usr/lib/python2.5/site-packages/Twisted-8.2.0-py2.5-linux-x86_64.egg/twisted/web/ 2009-11-06 16:56:59.000000000 +0100 @@ -186,6 +186,7 @@ class _WSGIResponse:

self.environ[name] = ','.join([

v.replace('\n', ' ') for v in values])



'wsgi.version': (1, 0), 'wsgi.url_scheme': request.isSecure() and 'https' or 'http',

Change History (2)

comment:1 Changed 11 years ago by Jean-Paul Calderone

Resolution: duplicate
Status: newclosed

Duplicate of #3585.

comment:2 Changed 9 years ago by <automation>

Owner: jknight deleted
Note: See TracTickets for help on using tickets.