Render Django Formset Manually
When i render my formset using a loop, everything works. When i try to render it manually by accessing each field separately ( for frontend purpose ) the form is rendering but the
Solution 1:
If you want to render each formset form field manually, you have to add Django default hidden fields.
<form method="post">
{% csrf_token %}
{{ formset.management_form }}
{% for p in formset %}
{{ p.id }} # if formset is ModelFormSet
{{ p.ORDER }} # if can_order=True
{{ p.DELETE }} # if can_delete=True
... # your custom fields
{% endfor %}
</form>
Post a Comment for "Render Django Formset Manually"