Before we can see the output of our work in a browser, we need to put together the template and build in the appropriate navigation to go to the next and previous pages.
Edit the mycompany/templates/press/list.html
file to look like this:
<html> <head> <title>Press Releases</title> </head> <body> <h1>Press Releases</h1> <ul> {% for press in press_list %} <li> <a href="{{ press.get_absolute_url }}"> {{ press.title }}</a> </li> {% endfor %} </ul> <p> Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} </p> <p> {% if page_obj.has_previous %} <a href="?page={{ page_obj.previous_page_number }}">Previous</a> {% else %} Previous {% endif %} | {% if page_obj.has_next %} <a href="?page={{ page_obj.next_page_number }}">Next</a> {% else %} Next {% endif %} </p> </body> </html>