title: Twisted server crashes unexpectedly while running django
body: <p>I am running a django application on twisted using the django-on-twisted scripts from <a href="http://code.google.com/p/django-on-twisted/">this site</a>.</p>
  
  <p>All requests are served by an nginx server which reverse proxies relevant requests to twisted. I have a url setup for an API, which basically just receives get requests and does some processing on the get parameters before sending a response. However, when a specific client is hitting the api, the twisted server just shuts down. Pasted below is the Nginx log:</p>
  
  <pre><code>the.ip.of.client - - [21/Apr/2012:11:30:36 -0400] "GET /api/url/?get=params&amp;more=params HTTP/1.1" 499 0 "-" "Java/1.6.0_24"
  </code></pre>
  
  <p>The twisted logs show nothing but twisted stops working at this point. By the error code 499, i am assuming that the client closed the connection unexpectedly, which I have no problem with. Whether the client receives the response or not is not important to me. Here is the relevant django view:</p>
  
  <pre><code>def api_url(request):
      if request.GET:
          get_param = request.GET.get('get', [''])[0]
          more_param = request.GET.get('more', [''])[0]
          #some processing here based on the get params
          return HttpResponse('OK')
      else:
          raise Http404
  </code></pre>
  
  <p>The request from the client is a valid request and does not affect the processing in an adverse way. I have tested it from the shell. When I tried it on the django development server, it crashed in the same way too without leaving any traces of receiving the request. Everything works perfectly well when testing it from the browser. Also, the twisted server works well for all the regular use cases. This is the first time I am facing an issue with it. Any help or pointers will be appreciated.</p>