title: Django throws error no. 10053 when receiving POST from jQuery
body: <p>I'm trying out jQuery to send POST and GET requests to Django.</p>
  
  <p>So far only GET is recognized, and POST I will get errors, and although GET works I cannot get the individual fields that I send to my Django app.</p>
  
  <p>So I wonder what's the problem, and how do I get POST to work?</p>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>def xhr_test(request):
      if request.is_ajax():
          if request.method == 'GET':
              message = "Hello GET Ajax"
              print request.GET
              print "hello"
          elif request.method == 'POST':
              message = "Hello POST Ajax"
              print request.POST
      else:
          message = "Hello"
      return HttpResponse(message)
  </code></pre>
  
  <p><strong>template</strong></p>
  
  <pre><code>&lt;html&gt;  
  &lt;head&gt;  
    &lt;title&gt;Ajax with jQuery Example&lt;/title&gt;  
    &lt;script type="text/JavaScript" src="{{ MEDIA_URL }}js/jquery.js"&gt;&lt;/script&gt;  
    &lt;script type="text/JavaScript"&gt;  
    $(document).ready(function() {
      $("#generate").click(function() {
        $.get("/ajax_fetch/xhr_test", function(data) {
        // alert(data);
        });
      });
  
      $("#generate_post").click(function() {
        $.post("/ajax_fetch/xhr_test", {
          name: "Monty"
        }, function(data) {
            alert(data)
        });
      });
    });
    &lt;/script&gt;  
  &lt;style type="text/css"&gt;  
      #wrapper {  
        width: 240px;  
        height: 80px;  
        margin: auto;  
        padding: 10px;  
        margin-top: 10px;  
        border: 1px solid black;  
        text-align: center;  
      }  
    &lt;/style&gt;  
  &lt;/head&gt;  
  &lt;body&gt;  
    &lt;div id="wrapper"&gt;  
      &lt;div id="quote"&gt;&lt;p&gt; &lt;/p&gt;&lt;/div&gt; 
      &lt;form method="get"&gt;
        &lt;p&gt;&lt;input type="text" name="user" /&gt;&lt;/p&gt;
        &lt;p&gt;&lt;input type="submit" id="generate" value="Generate!" /&gt;&lt;/p&gt;
      &lt;/form&gt;
  
      &lt;form method="post"&gt;{% csrf_token %}
        &lt;p&gt;&lt;input type="text" name="user" /&gt;&lt;/p&gt;
        &lt;p&gt;&lt;input id="generate_post" type="submit" value="Click" /&gt;&lt;/p&gt;
      &lt;/form&gt;
    &lt;/div
  &lt;/body&gt;  
  &lt;/html&gt; 
  </code></pre>
  
  <p><strong>Error trace</strong></p>
  
  <pre><code>Exception happened during processing of request from ('127.0.0.1', 1625)
  Traceback (most recent call last):
  
    File "c:\python27\lib\SocketServer.py", line 284, in _handle_request_noblock
      self.process_request(request, client_address)
    File "c:\python27\lib\SocketServer.py", line 310, in process_request
      self.finish_request(request, client_address)
    File "c:\python27\lib\SocketServer.py", line 323, in finish_request
      self.RequestHandlerClass(request, client_address, self)
    File "c:\python27\lib\site-packages\django\core\servers\basehttp.py", line 56
  , in __init__
      BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
    File "c:\python27\lib\SocketServer.py", line 641, in __init__
      self.finish()
    File "c:\python27\lib\SocketServer.py", line 694, in finish
      self.wfile.flush()
    File "c:\python27\lib\socket.py", line 301, in flush
      self._sock.sendall(view[write_offset:write_offset+buffer_size])
  error: [Errno 10053] An established connection was aborted by the software in y
  ur host machine
  </code></pre>