How to do `PUT` on Amazon S3 using Python Requests

Acording to this documentation you have pass the files argument to post method also need send the key name for S3

import requests

url = 'https://s3.amazonaws.com/<some-bucket-name>'

data = { 'key': 'test/test.jpeg' }
files = { 'file': open('test.jpeg', 'rb') }

r = requests.post(url, data=data, files=files)
print "status %s" % r.status_code

Engineers at requests helped me:

with open('img.png', 'rb') as data:
    requests.put(url, data=data)