Мой код выглядит так, но я не могу заставить его работать, поскольку не получаю ошибок.
Код: Выделить всё
import requests
from PIL import Image
from io import BytesIO
img = Image.new('RGB', (25, 25), color = (120, 120, 20))
byte_io = BytesIO()
img.save(byte_io, 'png')
byte_io.seek(0)
requests.post(
url('/media/upload'),
files={
'files[]': (
'1.png',
byte_io,
'multipart/form-data'
)
},
)
Код: Выделить всё
print filesПодробнее здесь: https://stackoverflow.com/questions/503 ... -in-python