1👍
✅
newdoc = Document(docfile = request.FILES['docfile'])
...
newdoc = Document(docfile1 = request.FILES['docfile1'])
...
newdoc = Document(docfile2 = request.FILES['docfile2'])
This will raise a MultiValueDictKeyError
if the key doesn’t exist. Use request.FILES.get()
with a default value.
👤knbk
Source:stackexchange.com