title: How to get checkbox values in django application
body: <p>I am trying to use a check box control in a simple <code>django</code> application. Code Logic seems to be fine, But I am getting an empty <code>fruit</code> list (<code>[None, None]</code>). I don't know why it's not working, Can anybody point out the mistake. Thanks in advance</p>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;div class="form-check"&gt;
  &lt;input class="form-check-input" type="checkbox" value="Apple" id="apple"&gt;
  &lt;label class="form-check-label" for="apple"&gt;Apple&lt;/label&gt;
  &lt;/div&gt;
  &lt;div class="form-check"&gt;
  &lt;input class="form-check-input" type="checkbox" value="Mango" id="mango"&gt;
  &lt;label class="form-check-label" for="mango"&gt;Mango&lt;/label&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p><strong>view.py</strong></p>
  
  <pre><code>if request.method == 'POST':
      fruit = []
      fruit.append(request.POST.get('apple'))
      fruit.append(request.POST.get('mango'))
  </code></pre>