[Django]-Django: after form.is_valid check, cleaned_data is missing the image field

16👍

Make sure you’ve used the correct enctype on your HTML form:

<form enctype="multipart/form-data" method="post" action="/foo/">

Also, make sure you bind request.FILES when you construct the form object.

# Bound form with an image field, data from the request
>>> f = ContactFormWithMugshot(request.POST, request.FILES)

Binding uploaded files to a form

Edit: File Uploads

Leave a comment