Fixed #21378 -- Updated tutorial02 for how to override admin site header.

This commit is contained in:
Vajrasky Kok 2013-11-09 18:27:37 +08:00 committed by Tim Graham
parent 14c1872d29
commit 10a39debb2
1 changed files with 5 additions and 2 deletions

View File

@ -475,8 +475,11 @@ template directory in the source code of Django itself
import django import django
print(django.__path__)" print(django.__path__)"
Then, just edit the file and replace the generic Django text with your own Then, just edit the file and replace ``{{ site_header }}`` with your own
site's name as you see fit. site's name as you see fit. We use this approach to teach you how to override
templates. In an actual project, you would probably use the
:attr:`django.contrib.admin.AdminSite.site_header` attribute to more easily
make this paritcular customization.
This template file contains lots of text like ``{% block branding %}`` This template file contains lots of text like ``{% block branding %}``
and ``{{ title }}``. The ``{%`` and ``{{`` tags are part of Django's and ``{{ title }}``. The ``{%`` and ``{{`` tags are part of Django's