Create the template file all_players.html in the templates folder as (myproject\players\templates\all_players.html) to show all the Player objects from the Players table as follows:
<!DOCTYPE html> <html> <body>
<h1>Players</h1>
<ul> {% for x in allplayers %} <li>{{ x.firstname }} {{ x.lastname }}</li> {% endfor %} </ul>
</body> </html>
Create View
Create the Players view in the players folder (myproject\players\views.py) as follows:
from django.http import HttpResponse from django.template import loader from .models import Player