1👍
✅
I think the problem here is the name of file element. It should be docfile
. In curl example you have passed that as docfile
but in the python script you left it as file
.
Alter this line:
files = {'file': open('file.ext', 'rb')}
to this:
files = {'docfile': open('file.ext', 'rb')}
0👍
When you look at the request in your view you may see it in request.FILES[‘file’]
I had a problem because I was had a bad setting in a headers file.
- [Answer]-Django custom form validation error
- [Answer]-Django Email As User Name
- [Answer]-Error starting mod_wsgi
- [Answer]-Why do we need fields value in Meta class in Django forms?
- [Answer]-Django filter and annotate
Source:stackexchange.com