title: how to cancel form w/o validation in django + bootstrap4
body: <p>Hi i am using django + bootstrap4 to render forms. I have 'submit' and 'cancel' buttons on the forms. i am using ModelForm with Validators assigned to most of the form attributes.</p>
  
  <h2>template file</h2>
  
  <pre><code>&lt;form action="{% url 'actor-create' %}" method="post" class="w-25 mx-auto"&gt;
      {% csrf_token %}
      {% bootstrap_form form layout="horizontal" %}
      &lt;button class="btn btn-primary" type="submit"&gt;&lt;i class="fas fa-plus"&gt;&lt;/i&gt; Save&lt;/button&gt;
      &lt;button class="btn btn-primary" type="submit"&gt;&lt;i class="fas fa-times"&gt;&lt;/i&gt; Cancel&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>in the view </p>
  
  <pre><code>def actor_create(request):
      # if this is a POST request we need to process the form data
      if request.method == 'POST':
          print(request.POST)
          if "cancel" in request.POST:
              return HttpResponseRedirect('/')
       ..... rest of the code
  </code></pre>
  
  <p>When cancel button is pressed validation of the form attributes prevents the form from submitting. so view functionality never gets executed.</p>
  
  <p>I want to know how to avoid validation when form is cancelled?</p>
  
  <p>Following Q&amp;A has a JavaScript based solution, I preferably don't want to write such code for every form in my website.
  <a href="https://stackoverflow.com/questions/25041009/how-to-cancel-form-submission">How to cancel form submission?</a></p>