title: Pagiantor on a search function
body: <p>I tried to add a Paginator of 5 posts to the current function but I always have developed with the ListView functions, in which is way easier to implement a pagiantor. Any suggestion?</p>
  <pre class="lang-py prettyprint-override"><code>    def search(request):
              query = request.GET.get(&quot;q&quot;, None)
              qs = DeathAd.objects.all()
              if query is not None:
                  qs = qs.annotate(
                      full_name = Concat('nome', Value(' '), 'cognome'),
                      full_cognome = Concat('cognome', Value(' '), 'nome')
                  ).filter(
                      Q(nome__icontains=query) |
                      Q(cognome__icontains=query) |
                      Q(full_name__icontains=query) |
                      Q(full_cognome__icontains=query)
                  )
      
              context = {
                  &quot;object_list&quot;: qs,
              }
              template = &quot;search.html&quot;
              return render(request, template, context)
  </code></pre>