title: How to paginate search results in Django?
body: <p>The code below searches for the word in dictionary, and render results on <em>search.html</em>, so I need to paginate results on that page, how can I do that? I read the arcticle here <a href="https://docs.djangoproject.com/en/1.9/topics/pagination/" rel="nofollow">https://docs.djangoproject.com/en/1.9/topics/pagination/</a>, but I have no idea how to embed the pagination code to mine. </p>
  
  <pre><code>def search(request):
      if 'results' in request.GET and request.GET['results']:
          results = request.GET['results']
          word = words.objects.filter(title__icontains = results).order_by('title')
          return render_to_response('myapp/search.html',
          {'word': word, 'query': results })
      else:
          return render(request, 'myapp/search.html')
  </code></pre>