title: Django - modal form and resubmission on page reload
body: <p>I have got a modal contact form. The form works fine, but the page reload resubmits previously entered values.</p>
  
  <p><strong>view.py</strong></p>
  
  <pre><code>...
  if request.POST:
      form = ContactForm(request.POST)
      if form.is_valid():
          entry = form.save()
          form = ContactForm()
          c.update(locals())
          return render(request, 'template.html', c )
  ...
  </code></pre>
  
  <p><strong>template.html</strong></p>
  
  <pre><code>&lt;form action="." method="post" id="contact-form"&gt;
  ...
  &lt;/form&gt;
  </code></pre>
  
  <p>I tried to clear the form in the GET request. Form fields are cleared, but this does not prevent submission on the page reload.</p>
  
  <pre><code>else: #request.GET
      form = ContactForm()
      c.update(locals())
      return render(request, 'template.html', c )
  </code></pre>
  
  <p>I have seen many examples suggesting a redirect. I do understand this approach, but in case of a modal form I would like to avoid a redirect.</p>
  
  <p>How to prevent modal form re-submissions? Is the redirect really the only way?</p>