title: Use order by in pagination result Django
body: <p>I want to order by only pagination result, for example in the first page I get two products <em>(the meaning of this mehsul is a product)</em> and when I get ordering I want to order these two products.</p>
  <pre class="lang-py prettyprint-override"><code>    def animal(request,slug):
          mehsul=Product.objects.filter(animal_type=slug)
          animal_count=2
          paginator=Paginator(mehsul,animal_count)
          page_number=request.GET.get('page')
          page_obj = paginator.get_page(page_number)
          ordering = request.GET.get('ordering')
  
      if ordering:
          mehsul = Product.objects.filter(animal_type=slug)
          paginator=Paginator(mehsul,animal_count)
          page_number=request.GET.get('page')
          page_obj=paginator.get_page(page_number)
      return render(request,'animal.html',context={'mehsullar':page_obj})
  </code></pre>