擅长:python、mysql、java
<pre><code><form method="post" novalidate>{% csrf_token %}
{{ form.non_field_errors }}
{% for hidden_field in form.hidden_fields %}
{{ hidden_field.errors }}
{{ hidden_field }}
{% endfor %}
<table border="1">
{% for field in form.visible_fields %}
<tr>
<th>{{ field.label_tag }}</th>
<td>
{{ field.errors }}
{{ field }}
{{ field.help_text }}
</td>
</tr>
{% endfor %}
</code></pre>
<p/>
<p>看这篇文章:[link][1]<a href="https://simpleisbetterthancomplex.com/article/2017/08/19/how-to-render-django-form-manually.html" rel="nofollow noreferrer">https://simpleisbetterthancomplex.com/article/2017/08/19/how-to-render-django-form-manually.html</a></p>