【发布时间】:2019-01-09 16:36:41
【问题描述】:
我创建了一个 django 表单并将其输出到模板中。但我不明白如何添加引导样式,因为这个 django 表单不好。
输出图像:
代码:
{% extends 'base.html' %}
{% block title %}
Contact Us
{% endblock %}
{% block content %}
<h1>Contact Us</h1>
<form method="post">
{% csrf_token %}
{% for field in form %}
<div class="form-group">
{{ field.label }}
{{ field }}
</div>
{% endfor %}
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
<button class="btn btn-primary" type="submit" name="button">Send</button>
</form>
{% endblock %}
【问题讨论】:
标签: python html css django twitter-bootstrap