title: IOError: request data read error
body: <p>I'm getting an IO request data read error when trying to loading data as Excel in response.</p>
  
  <pre><code>def convert_to_excel(request):
      field = forms.CharField()
      try: data = field.clean(request.POST.get('exceldata', ''))
      except: data = u''
      response = render_to_response("spreadsheet.html", request= request, dictionary = locals())
      filename = "%s%s.xls" % ("report_excel", datetime.datetime.today().strftime('%Y%m%d%H%M%S'))
      response['Content-Disposition'] = 'attachment; filename='+filename
      response['Content-Type'] = 'application/vnd.ms-excel; charset=utf-8'
      return response
  </code></pre>
  
  <p>It works fine when the data is under 150k, but the bigger file fails at around 200k. I'm running django 1.4 Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 with daemon mode and Python/2.7.3.</p>
  
  <p>This works fine in localhost. I guess this might be an issue or bad configuration of wsgi with daemon mode. Does anyone know about this?</p>
  
  <p>The exception I am getting is below.</p>
  
  <pre><code>Traceback (most recent call last):
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 89, in get_response
     response = middleware_method(request)
  
   File "/usr/local/lib/python2.7/dist-packages/newrelic-1.2.1.265-py2.7.egg/newrelic/hooks/framework_django.py", line 191, in __call__
     result = self.__wrapped(*args, **kwargs)
  
   File "/home/core/mysite/src/task/tools/libs/pagination/middleware.py", line 8, in process_request
     request.page = int(request.REQUEST.get('page', 1) )
  
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 166, in _get_request
     self._request = datastructures.MergeDict(self.POST, self.GET)
  
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 180, in _get_post
     self._load_post_and_files()
  
   File "/usr/local/lib/python2.7/dist-packages/django/http/__init__.py", line 360, in _load_post_and_files
     self._post, self._files = self.parse_file_upload(self.META, data)
  
   File "/usr/local/lib/python2.7/dist-packages/django/http/__init__.py", line 320, in parse_file_upload
     return parser.parse()
  
   File "/usr/local/lib/python2.7/dist-packages/newrelic-1.2.1.265-py2.7.egg/newrelic/api/function_trace.py", line 82, in __call__
     return self._nr_next_object(*args, **kwargs)
  
   File "/usr/local/lib/python2.7/dist-packages/django/http/multipartparser.py", line 161, in parse
     data = field_stream.read()
  
   File "/usr/local/lib/python2.7/dist-packages/django/http/multipartparser.py", line 301, in read
     out = ''.join(parts())
  
   File "/usr/local/lib/python2.7/dist-packages/django/http/multipartparser.py", line 285, in parts
     yield ''.join(self)
  
   File "/usr/local/lib/python2.7/dist-packages/django/http/multipartparser.py", line 316, in next
     output = self._producer.next()
  
   File "/usr/local/lib/python2.7/dist-packages/django/http/multipartparser.py", line 449, in next
     for bytes in stream:
  
   File "/usr/local/lib/python2.7/dist-packages/django/http/multipartparser.py", line 316, in next
     output = self._producer.next()
  
   File "/usr/local/lib/python2.7/dist-packages/django/http/multipartparser.py", line 377, in next
     data = self.flo.read(self.chunk_size)
  
   File "/usr/local/lib/python2.7/dist-packages/django/http/__init__.py", line 384, in read
     return self._stream.read(*args, **kwargs)
  
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 104, in read
     result = self.buffer + self._read_limited(size - len(self.buffer))
  
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 92, in _read_limited
     result = self.stream.read(size)
  
   File "/usr/local/lib/python2.7/dist-packages/newrelic-1.2.1.265-py2.7.egg/newrelic/api/web_transaction.py", line 349, in read
     data = self.__input.read(*args, **kwargs)
  
  IOError: request data read error
  </code></pre>