Skip to content

Instantly share code, notes, and snippets.

@mbrochh
Created July 29, 2011 05:19
Show Gist options
  • Select an option

  • Save mbrochh/1113180 to your computer and use it in GitHub Desktop.

Select an option

Save mbrochh/1113180 to your computer and use it in GitHub Desktop.
Pagination in Django Template Example
<div class="pagination">
<span class="step-links">
{% if page_obj.has_previous %}
<a id="paginLeft" href="?page={{ page_obj.previous_page_number }}">previous</a>
{% endif %}
<span class="current">
{{ page_obj.number }} {% trans "of" %} {{ page_obj.paginator.num_pages }}
</span>
{% if page_obj.has_next %}
<a id="paginRight" href="?page={{ page_obj.next_page_number }}">next</a>
{% endif %}
</span>
</div>
@alinouri76

Copy link
Copy Markdown

Can you explain what does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment