I’m a bit of a noob regarding django framework. I started learning it today and I already have an issue with what I’ve done and I couldn’t figure out why.
I wanted to setup a master template, called master.html and use 2 other pages: all_members.html and details.html
Here is the exact code:
master.html
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %}</title>
</head>
<body>
{% block content %}
{% endblock %}
</body>
</html>
all_members.html
{% extends "master.html" %}
{% block title %}
My Tennis Club - List of all members
{% endblock %}
{% block content %}
<h1>Members</h1>
<ul>
{% for x in mymembers %}
<li><a href="details/{{ x.id }}">{{ x.firstname }} {{ x.lastname }}</a></li>
{% endfor %}
</ul>
{% endblock %}
details.html
{% extends "master.html" %}
{% block title %}
Details about {{ mymember.firstname }} {{ mymember.lastname }}
{% endblock %}
{% block content %}
<h1>{{ mymember.firstname }} {{ mymember.lastname }}</h1>
<p>Phone {{ mymember.phone }}</p>
<p>Member since: {{ mymember.joined_date }}</p>
<p>Back to <a href="/dev">Members</a></p>
{% endblock %}
Here is what the page looks like:
To be sure, the title "My Tennis Club" should be displayed, right ?
I can’t figure out why it could not…
Thank you for your help
>Solution :
HTML <title> tag sets text displayed within the browser’s title bar – NOT inside page content.
Here’s a nice W3 tutorial page about this tag: <title>
Probably it’s getting set as expected – but on the title bar?
