title: How can I access the form submit button value in Django?
body: <p>I have a Django project that, on one page, has multiple forms (in different  tags) that can be submitted to have different effects. In all cases I want the user to be redirected back to the same page, so I use in my view the pattern of submitting the form and then redirecting to the original page. In at least one case, the only difference between two of the forms is the value of the submit button.</p>
  
  <p>In my view I have the code (which is the first time my view function accesses the <code>request.POST</code>):</p>
  
  <pre><code>if request.POST['submit']=='Add':
      #code to deal with the "Add" form
  </code></pre>
  
  <p>and in the template, the first form has a submit button like
  </p>
  
  <pre><code>&lt;input type="submit" value="Add"&gt;
  </code></pre>
  
  <p>I thought this would work, but when I submit that form, I get an error at the line in view from above:</p>
  
  <blockquote>
    <p>Key 'submit' not found in <code>&lt;QueryDict: {u'clientyear': [u'2012'], u'csrfmiddlewaretoken': [u'be1f2f051f09f6ab0375fdf76cf6a4d7'], u'ben': [u'123405']}&gt;</code></p>
  </blockquote>
  
  <p>Obviously, this does not have a <code>'submit'</code> key or any key with the value corresponding to the submit button I clicked. So, since this does not work, how can access the value of the submit button or tell which of the forms has been submitted?</p>