title: How to prevent 'IOError: failed to write data' when client closes connection to Django/WSGI app?
body: <p>I have an iPhone app that is using web services implemented in Python, using Django and Piston, running on an apache server through WSGI.</p>
  
  <p>Sometimes the app closes its connection to the server before a call is finished.  When it does this it causes a:</p>
  
  <pre><code>[Tue Sep 06 11:29:46 2011] [error] [client 207.35.164.99] mod_wsgi (pid=820): Exception occurred processing WSGI script 'myscript.wsgi'.
  [Tue Sep 06 11:29:46 2011] [error] [client 207.35.164.99] IOError: failed to write data
  </code></pre>
  
  <p>to appear in my server's error logs.</p>
  
  <p>I can "fix" the problem in the app by not explicitly closing the connection, but just leaving it to finish downloading and ignoring the result.  However, I'd like fix this on the server-side if possible.  How can I do it?</p>