'django disable button until file is uploaded

I would like to disable my button until a file is uploaded, how can I do this?

my html code

{% extends 'base.html' %}

{% block content %}
<center>
  <h1>Upload your file</h1>
    <form method="post" enctype="multipart/form-data">
        {% csrf_token %}

        <label class="custom-file-upload">
        <input  type="file" name="document"><br/>
        </label>

        <button class="button button1" type="submit">Upload file</button>
    </form>

  {% if url %}
    <p>Uploaded file: <a href="{{ url }}">{{ url }}</a></p>
  {% endif %}

{{ return_value }}
</center>
{% endblock %}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source