title: Django - Paginating in Template using multiple GET parameters
body: <p>I am using a Django Paginator and I want to have multiple available get parameters, such as:
  page=1
  sort_by=price</p>
  
  <p>However, in my template tags I have:</p>
  
  <pre><code>Showing items sorted by {{ SORT_PARAM }}.
  Showing {{ ITEMS_PER_PAGE }} items per page.
  
  {% if has_prev %}
  &lt;a href="?page={{ prev_page }}"&gt;Previous&lt;/a&gt; |
  {% endif %}
  </code></pre>
  
  <p>However, this does not preserve the other GET variables. What I mean is, if I'm viewing</p>
  
  <pre><code>page/?page=1&amp;sort_by=price
  </code></pre>
  
  <p>and I click the link in the template fragment above, I will go to</p>
  
  <pre><code>page=2
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>page=2&amp;sort_by=price
  </code></pre>
  
  <p>What I mean is, the a href does not preserve the other GET parameters.</p>
  
  <p>One solution is I could type all the possible GET parameters in the a href, such as</p>
  
  <pre><code>&lt;a href="?page={{ prev_page }}&amp;items_per_page={{ ITEMS_PER_PAGE }}&amp;sort_param={{ SORT_PARAM }}"&gt;Previous&lt;/a&gt;
  </code></pre>
  
  <p>but this will become less scalable the more arguments I want to add to my browsing. I'm guessing there should be an automated way to obtain all GET parameters, and then pass those and one more?</p>