I'm trying to get an image then turn it into an object Python understands then upload.
This is what I have tried:
# Read the image using .count to get binary
image_binary = requests.get(
"http://danealva143.files.wordpress.com/2014/03/2012-08-girls-920-26.jpg").content
string_buffer = io.BytesIO()
string_buffer.write(image_binary)
string_buffer.seek(0)
files = {}
files['image'] = Image.open(string_buffer)
payload = {}
results = requests.patch(url="http://127.0.0.1:8000/api/profile/94/", data=payload, files=files)
I get this error:
File "/Users/user/Documents/workspace/test/django-env/lib/python2.7/site-packages/PIL/Image.py", line 605, in __getattr__
raise AttributeError(name)
AttributeError: read
Why?