On Thursday, September 16, 2010, btimby <[email protected]> wrote: > I have read: > > http://code.google.com/p/modwsgi/wiki/ChangesInVersion0300 > and > http://code.google.com/p/modwsgi/issues/detail?id=1 > > I am OK with stepping outside the WSGI spec for doing chunked > requests. I am generating a large amount of data on the client and > wish to avoid buffering there. > > Graham, you mentioned possible WSGI middleware to be used with Django > that could do this? Do you have any pointers, samples or additional > information that could help me?
Not sure what you are referring to. Django itself can't handle streaming of request content, at least not of unknown length. If you wrap Django with a WSGI middleware that reads wsgi.input in blocks and writes it all to a file, then calculate the length and update CONTENT_LENGTH, when Django processes it, it will I believe if being handled as a file upload, read it in blocks and write it to yet another file. Pretty silly really. If processed as a form, then reads it all into memory which if large amount of data, may blow out memory usage. So trying to do this in conjunction with Django may not work very well. What is request content, an upload of raw data, or some sort of form type post, possibly including file datat? Graham > I am aware of the other option which is to buffer the request using > mod_proxy or nginx which could then insert the Content-Length header. > I would rather something that works not only on my production > webserver, but on the django test webserver (python manage.py > runserver). If that is possible, that would be my preferred solution. > > Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" 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/modwsgi?hl=en. > > -- You received this message because you are subscribed to the Google Groups "modwsgi" 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/modwsgi?hl=en.
