<form action="" method="post">
    {% csrf_token %}
     {% for field in form.visible_fields %}
        <div class="form-group">
          <label class="col-sm-2 control-label">{{ field.label }}:</label>
          <div class="col-sm-5">
              {{ field }}
          </div>
          <div class="col-sm-5 help-block">
            {%if field.field.required%}
              <span class="text-red">必填</span>
            {%else%}
              <span class="text-muted">选填</span>
            {%endif%}
            {{ field.help_text|safe}}
            <div class="text-red">{{ field.errors|safe }}</div>
          </div>
        </div>
      {% endfor %}
    <input type="submit" class="btn btn-default" value="Update" />
</form>