python - django无法上传文件?
大家讲道理
大家讲道理 2017-04-18 09:59:34
0
1
337
大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
伊谢尔伦

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template