伊谢尔伦2017-04-18 10:01:34
If you need to upload files, you need to specify the enctype="multipart/form-data"
attribute in the form and change the form to:
<form action="{% url 'backend:upload' %}" method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form }}
<button type="submit">Submit</button>
</form>
Please read the document content carefully, it mentions this.