Django forms: “This field is required” when file POSTed to file field

Make sure that your form has the enctype set, e.g.:

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

From the docs:

Note that request.FILES will only contain data if the request method was POST and the <form> that posted the request has the attribute enctype=”multipart/form-data”. Otherwise, request.FILES will be empty.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)