title: Muliple submit button on single form in Django
body: <p>Within a form, I have two submit buttons. Depending on which button the user clicks on, I want the redirect on form.is_valid() to either be page A or page B. Do you know how I might be able to attach a different value to each submit button and pass this value on the POST request so that I can evaluate it in my view?</p>
  
  <p>template.html</p>
  
  <pre><code>&lt;div class="submitbutton""&gt;
                  &lt;button type="submit"&gt;
                     Submit A
                  &lt;/button&gt;
              &lt;/div&gt;
  
    &lt;div class="submitbutton""&gt;
                  &lt;button type="submit"&gt;
                     Submit B
                  &lt;/button&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code> if request.method == 'POST':
  
      &lt;!-- a bunch of code that works --&gt;
  
  
     if user_clicked_SubmitA:     
           return redirect('profile')
  
     if user_clicked_SubmitB:
           return redirect('home')
  </code></pre>
  
  <p>THanks!</p>