title: No Product matches the given query - Search form
body: <p>I'm trying to create a search form in Django, but I'm receiving this error:</p>
  
  <pre><code>Page not found (404)
  Request Method: GET
  Request URL:    http://127.0.0.1:8000/search/?q=cddsc
  No Product matches the given query.
  </code></pre>
  
  <p>This is my form:</p>
  
  <pre><code>&lt;form class="search_form" action="/search/" method="get"&gt;
    &lt;input type="text" name="q" Placeholder="Buscar"&gt;
    &lt;button type="button" class="btn btn-primary btn-lg" value="Search"&gt;
    &lt;span class="glyphicon glyphicon-star"&gt; Buscar&lt;/span&gt;
    &lt;/button&gt;                 
  &lt;/form&gt;
  </code></pre>
  
  <p>This is my url:</p>
  
  <pre><code>url(r'^search/$', 'reviews.views.search'),
  </code></pre>
  
  <p>This is my view:</p>
  
  <pre><code>def search(request):
      if 'q' in request.GET and request.GET['q']:
          message = 'You search for: %r' % request.GET['q']
          return render(request,'search.html', {'msg':message})
      else:
          message = 'You submited an empty form'
          return render(request,'home.html', {'msg':message})
  </code></pre>
  
  <p>The message returns that no product matches, but I didn't query the product model yet. Why Django returns this message?</p>
  
  <p>This is my product model:</p>
  
  <pre><code>class Product(models.Model):
      name = models.CharField(max_length=500)
      #inserir campo imagem
      #inserir slugify na url do produto
      slug = models.SlugField(max_length=500)
      category = models.ForeignKey(Category)
      image = models.ImageField(upload_to='thumbs/')
      created = models.DateTimeField(auto_now=True, auto_now_add=False)
      updated = models.DateTimeField(auto_now=True, auto_now_add=True)
  
      def reviews(self):
          return Review.objects.filter(product = self.pk)
  
      def __unicode__(self):
          return u'%s' % self.name
  </code></pre>