title: How to retrieve value from checkbox defined in django template
body: <p>I have created a menu with three options(home,change password and logout). In home I am displaying all the books stored in the database. Now I want to filter the contents based on categories of the books using checkbox. By default all the books are shown upon filtering the category only the books of that category should be shown.But for me it is showing all the books even after clicking on all the checkbox (checkbox contains the categories).I think there is some problem in my template file.  </p>
  
  <p>urls.py,</p>
  
  <pre><code> url(r'^welcome_user/$',views.welcome_user, name='welcome_user'),
  </code></pre>
  
  <p>Models.py,</p>
  
  <pre><code>class Add_cat(models.Model):
      category = models.CharField("Name",max_length=25,unique=True)
  
      def __unicode__(self):
          return u'{0}'.format(self.category)
  
  class Add_prod(models.Model):
      book = models.CharField("Book Name",max_length=40)
      author = models.CharField("Author",max_length=30)
      price = models.PositiveIntegerField("Price")
      image = models.ImageField(upload_to='images',null=True)
      cat = models.ForeignKey(Add_cat,on_delete=models.CASCADE)
  </code></pre>
  
  <p>Template file,</p>
  
  <pre><code>{% block content %}
  {% load staticfiles %}
  &lt;head&gt;
  &lt;link rel="stylesheet" href="{% static 'style.css' %}"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="box"&gt;
      &lt;div class="sideNav"&gt;
          &lt;form action="{% url 'welcome_user' %}"&gt;
              &lt;p id=id3&gt;Categories&lt;/p&gt;
              &lt;hr&gt;
              {% for i in products %}
                  &lt;input type="checkbox" name="cat_name" value="{{i.cat}}"&gt;{{i.cat}}&lt;br&gt;
              {% endfor %}
          &lt;button type="submit"&gt;Submit&lt;/button&gt;
          &lt;/form&gt;
      &lt;/div&gt;
      &lt;div&gt;
          {% for i in products %}
              &lt;div style="display:inline-block;margin:30px"&gt;
                  &lt;img src="{{i.image.url}}" alt="No Image" width=196px height=196px&gt;
                  &lt;p id=id4&gt;Rs.{{i.price}}&lt;/p&gt;
              &lt;/div&gt;
          {% endfor %}
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt; 
  {% endblock %}
  </code></pre>
  
  <p>Views.py,</p>
  
  <pre><code>@login_required   
  def welcome_user(request):      
      if 'cat_name' in request.GET:
         filter_category = request.GET.getlist('cat_name')
         my_products = Add_prod.objects.filter(cat__in=filter_category) 
         context = { "products":my_products}
      else:
         my_products = Add_prod.objects.all()     
         context = { "products":my_products}
  return render(request,"welcome-user.html",context)
  </code></pre>