55👍
✅
As you haven’t posted your view, I can only guess its because you forgot to include request.FILES
:
form = ProfileForm(request.POST, request.FILES)
And perhaps forgot to add enctype=multipart/form-data
to your form.
6👍
Add enctype="multipart/form-data"
<form enctype="multipart/form-data" method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Upload</button>
</form>
- How to make Django Password Reset Email Beautiful HTML?
- Django 2.0: sqlite IntegrityError: FOREIGN KEY constraint failed
- Django static files on heroku
- Django + uWSGI + Nginx + SSL – request for working configuration (emphasis on SSL)
Source:stackexchange.com