[Answer]-I got error when I submit with django form

1đź‘Ť

âś…

You get “This field is required” error not below the price input box but above image selector. You forget to pass request.FILES argument to the ProductImageForm:

product_image_form = ProductImageForm(request.POST or None,
                                      request.FILES or None)

And don’t forget to specify enctype attribute in your <form> tag:

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

Leave a comment