4👍
There is nothing wrong with what you are doing, the problem is how the template’s default
filter works.
This filter will give the value on the right of the |
, if the value of the left of the |
is not passed to the template.
Since the django admin application is passing in a value for site_title
, the default filter is not triggered.
If you were really trying to change the title displayed, you can set the value of site_title
by customizing the django admin (as you move further in the tutorial, you will learn more about customizing the admin, which will make the link clearer).
If you just want to see if your setup is correct, you can change the template to the following:
{% block title %}
Foo: {{ title }} | {{ site_title|default:_('My Admin Title') }}
{% endblock %}
Then refresh your admin site and watch the title of the page.
Source:stackexchange.com