1👍
✅
Method update_with_media() has only one positional argument which takes filename.
So you can specify filename something like this:
api.update_with_media(request.FILES['file'].name,
status="Hello first image")
Also you should pass file using keyword argument ‘file’:
api.update_with_media(request.FILES['file'].name,
file=request.FILES['file'],
status="Hello first image")
1👍
As per docs, you have to pass both file
parameter which will be opened internally and filename
parameter which is needed to determine MIME type and will be used to as form field in post data. So just pass them explicitly as keyword arguments and you should be fine.
- [Answered ]-Django Channels Group.send not working in python console?
- [Answered ]-How can i make signals in django which can differentiate between put and post method?
- [Answered ]-Newbie – Django Project with Multiple Apps – Unable to render Views
Source:stackexchange.com