title: Why use management form inside template?
body: <p>I am reading Django docs and don’t quite understand the comment below about formsets.</p>
  <p>Why do I need to be aware to use the management form inside the management template in this example ?</p>
  <p>Using a formset in views and templates</p>
  <p>Using a formset inside a view is as easy as using a regular Form class. The only thing you will want to be aware of is making sure to use the management form inside the template. Let’s look at a sample view:</p>
  <pre><code>from django.forms import formset_factory
  from django.shortcuts import render
  from myapp.forms import ArticleForm
  
  def manage_articles(request):
       ArticleFormSet = formset_factory(ArticleForm)
       if request.method == 'POST':
          formset = ArticleFormSet(request.POST, request.FILES)
          if formset.is_valid():
              # do something with the formset.cleaned_data
              pass
      else:
          formset = ArticleFormSet()
      return render(request, 'manage_articles.html', {'formset': formset})
  
  # manage_articles.html
  
  &lt;form method=&quot;post&quot;&gt;
      {{ formset.management_form }}
      &lt;table&gt;
          {% for form in formset %}
          {{ form }}
          {% endfor %}
      &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>