diff options
| author | Tim Graham <timograham@gmail.com> | 2014-10-08 08:19:11 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-10-08 08:19:11 -0400 |
| commit | e949f4435fb8fb0b874cf8bb0ba9d61d423152f2 (patch) | |
| tree | bb569b1e411f2e4813639c778208d2f6d420fd5f /docs | |
| parent | 0eccf8fbea143234c9af3d290d41d5c315e714f9 (diff) | |
Fixed #23587 -- Clarified admin template overriding in tutorial 2.
Thanks Petrus van Bork for the report.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/intro/tutorial02.txt | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt index 42e895513a..e67c3863b5 100644 --- a/docs/intro/tutorial02.txt +++ b/docs/intro/tutorial02.txt @@ -512,11 +512,18 @@ template directory in the source code of Django itself print(django.__path__)" Then, just edit the file and replace -``{{ site_header|default:_('Django administration') }}`` with your own site's -name as you see fit, e.g. ``{{ _('Polls administration') }}``. 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 particular customization. +``{{ site_header|default:_('Django administration') }}`` (including the curly +braces) with your own site's name as you see fit. You should end up with +a line like: + +.. code-block:: html+django + + <h1 id="site-name"><a href="{% url 'admin:index' %}">Polls Administration</a></h1> + +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 particular customization. This template file contains lots of text like ``{% block branding %}`` and ``{{ title }}``. The ``{%`` and ``{{`` tags are part of Django's |
