Adding list games views

As we are not displaying all the items on the first page, we need to build pages that will display all the items if the user clicks on See more items link. This should be fairly simple, as we already have a partial view that lists the games for us.

Let's create two more URLs in the url.py file of the main app, and let's add these two to the urlpatterns list:

    path(r'games-list/highlighted/', views.show_highlighted_games),    path(r'games-list/all/', views.show_all_games),

Perfect! Now we need to add one template to list all the games. Create a file called all_games.html at gamestore/main/templates/main with the following contents:

{% extends 'base.html' %}{% block 'content' %} <h2>Highlighted games</h2> <hr/> {% if games ...

Get Python Programming Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.