【发布时间】:2022-01-05 10:53:55
【问题描述】:
我在将引导上传表单与 django 表单(脆表单)结合起来时遇到了麻烦。知道如何将酥脆的表单放入引导表单。
这是 django 脆皮表格
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form|crispy }}
<button type="submit" class="btn btn-primary">Upload and Download!</button>
</form>
这是我想放脆形式的引导形式。
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="custom-file">
<input type="file" class="custom-file-input" id="customFile">
<label class="custom-file-label" for="customFile">Choose file</label>
</div>
知道如何将这两者结合起来吗?
【问题讨论】:
-
你的 forms.py 是什么样的?
标签: python html django bootstrap-4 django-crispy-forms