title: Django pagination and "current page"
body: <p>I'm currently developing a Django application which will make use of the infamous "pagination" technique.  I'm trying to figure out how the django.core.paginator module works.</p>
  
  <p>I have an application with a Question model.  I will be listing all of the questions using this paginator.  There will be 20 questions per page.</p>
  
  <pre><code>def show_question(question_pk):
      questions = Question.objects.all()
      paginator = Paginator(questions, 20)
      page      = ... # Somehow figure out which page the question is on
      return render_to_response('show_question.html', { 'page' : page })
  </code></pre>
  
  <p>In the view, where I list the different pages as "... 2, 3, <strong>4</strong>, 5, 6, ..." I want to highlight the current page somehow, like many pages do.</p>
  
  <p>There are really two things I want to know:</p>
  
  <ol>
  <li>How do I make Django figure out which page the question is located at?</li>
  <li>How would I write my template to properly "highlight" the currently visited page?</li>
  </ol>
  
  <p>EDIT: Sorry, I forgot part of this question.  I would also like any page except for the current one to be a link to <code>/questions/{{ that_page.start_index }}</code>.  So basically every page link would link to the first question on that page.</p>