CCCPaste

Solve the problem with doubled button for video

The additional button that appears when you click on "Add Place" might be due to the  element that you added in your form. You are already using Django's built-in form handling, so you don't need to manually add another file input element.

To resolve this issue, you should remove the manual file input from your template and let Django handle the file upload through the video field in your PlaceCreateForm.

Here's how you can modify your template to remove the manual file input:

html
Copy code
{% extends 'base.html' %}

{% block main_content %}
    

Add Place

{{ form }} {% csrf_token %}
{% endblock %} By removing the manual file input, you ensure that only the file input associated with the video field in your form is processed, eliminating the appearance of an extra button. User So, you have in mind that this row is not necessary in place_from.html, because Django takes this from the form, right? Am I understood correctly? ChatGPT Yes, that's correct. When you define a FileField in your Django form, Django automatically generates the necessary HTML input elements to handle file uploads. Therefore, manually adding elements in your template for fields like video is unnecessary and can lead to unexpected behavior, such as the appearance of an extra button. By relying on Django's form handling, you ensure that file uploads are processed correctly and consistently with the rest of your form fields. So, you don't need to manually add elements for file fields defined in your Django forms.