19👍
✅
Well, my suspicions were confirmed: I am an idiot 🙂
The method I outline in my question is, in fact, correct — it wasn’t working because I’d forgotten to include enctype="multipart/form-data"
on the form.
Anyway, I’ll leave this question here, just incase other people have the same problem.
0👍
I also had issues with file not really posted to server when name attribute was not specified in input tag
<input type="file" name="somename">
- Django AttributeError Model object has no attribute 'filter'
- Django unique model fields validation in form
- Django ArrayField null=True migration with Postgresql
Source:stackexchange.com