Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is a not a Django issue. It is a limitation of the WSGI specification itself in as much as the WSGI specification prohibits use of chunked request content by requiring a CONTENT_LENGTH value for request.</p> <p>When using mod_wsgi there is a switch for enabling non standard support for chunked request content, but that means your application isn't WSGI compliant, plus it would require a custom web application or WSGI wrapper as it still isn't going to work with Django.</p> <p>The option in mod_wsgi to allow chunked request content is:</p> <pre><code>WSGIChunkedRequest On </code></pre> <p>Your WSGI wrapper should call wsgi.input.read() to get whole content, created a StringIO instance with it and use that to replace wsgi.input and then also add a new CONTENT_LENGTH value to environ with actual length before calling wrapped application.</p> <p>Do note this is dangerous because you will not know how much data is being sent.</p> <p>What client are you using anyway that only supports chunked request content?</p> <hr> <p><strong>UPDATE 1</strong></p> <p>Your code is broken for numerous reasons. You should be using something like:</p> <pre><code>import StringIO django_application = get_wsgi_application() def application(environ, start_response): if environ.get("mod_wsgi.input_chunked") == "1": stream = environ["wsgi.input"] data = stream.read() environ["CONTENT_LENGTH"] = str(len(data)) environ["wsgi.input"] = StringIO.StringIO(data) return django_application(environ, start_response) </code></pre> <p>Note that this will not help with gzip'd request content. You would need an additional check for that to see when content encoding was compressed data and then do same as above. This is because when data is uncompressed by Apache the content length changes and you need to recalculate it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload