title: Python script using requests to post files to Django app - Nothing in request.FILES
body: <p>Using Django 1.5 and Python 2.7.3. </p>
  
  <p>Simple example to demonstrate my problem. I can't send files to our Django webapp using Python + requests. I'm using a script that resides on my computer and testing using Django's built in server (also running locally).</p>
  
  <p>I've followed <a href="http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file" rel="nofollow">the example here</a> on how to post files but <code>requests.FILES</code> is empty.</p>
  
  <h3>script.py</h3>
  
  <pre><code>import requests
  import os
  
  url="http://&lt;myurl&gt;/upload"
  files={'file':('myfile.txt', open('myfile.txt', 'rb'))}
  r=requests.post(url, files = files)
  r.text  # Number of files in request.FILES: 0
  </code></pre>
  
  <h3>views.py</h3>
  
  <pre><code>def upload(request):
    return HttpResponse("Number of files in request.FILES: {0}".format(len(request.FILES)))
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Headers: <code>{'date': 'Tue, 11 Jun 2013 15:10:13 GMT', 'content-type': 'text/html; charset=utf-8', 'server': 'WSGIServer/0.1 Python/2.7.3'}</code></p>
  
  <p>The URL is correct (I can see the response text in my script). The script works when I point the URL to <code>http://httpbin.org/post</code> as in the example. </p>
  
  <p>Is there something in my <code>requests.post</code> that I'm missing?</p>