1👍
✅
You need to change your form tag:
<form method="POST" action="" enctype="multipart/form-data">
From the documentation:
Note that
request.FILES
will only contain data if the request method wasPOST
and the<form>
that posted the request has the attributeenctype="multipart/form-data"
. Otherwise,request.FILES
will be empty.
Source:stackexchange.com