109
Well I feel like an idiot. In order for Django to be able to process uploaded files, you need to pass the request.FILES variable to the form (makes sense, right?!)
In my case the following line goes from:
f = AdminEditForm(request.POST, instance = company)
To:
f = AdminEditForm(request.POST, request.FILES, instance = company)
Another thing to check (if you run into something like this in the future) is that your form is multipart. Your <form>
tag should look something like this:
<form enctype="multipart/form-data" method="post" action="">
- [Django]-Django REST Framework custom fields validation
- [Django]-Is there a naming convention for Django apps
- [Django]-Django SUM Query?
Source:stackexchange.com