Change Templates to use the Master Template
Changing All Players Template
- Change the list of all players template (myproject\players\templates\all_players.html) as follows:
{% extends "master.html" %}
{% block title %}
Chelsea Football Club - List of all Players
{% endblock %}
{% block content %}
<h1>Players</h1>
<ul>
{% for x in allplayers %}
<li><a href="details/{{ x.id }}">{{ x.firstname }} {{ x.lastname }}</a></li>
{% endfor %}
</ul>
{% endblock %}
Changing Players Detail Template
- Change the Players Detail template (myproject\players\templates\details.html) as follows:
{% extends "master.html" %}
{% block title %}
Player Details of {{ theplayer.firstname }} {{ theplayer.lastname }}
{% endblock %}
{% block content %}
<h1>{{ theplayer.firstname }} {{ theplayer.lastname }}</h1>
<p>Phone {{ theplayer.phone }}</p>
<p>Date of Birth: {{ theplayer.dateofbirth }}</p>
<p>Back to <a href="/players">Players</a></p>
{% endblock %}