8000 [1.7.x] Fixed #23587 -- Clarified admin template overriding in tutori… · alex-python/django@b2f7b51 · GitHub
[go: up one dir, main page]

Skip to content

Commit b2f7b51

Browse files
committed
[1.7.x] Fixed #23587 -- Clarified admin template overriding in tutorial 2.
Thanks Petrus van Bork for the report. Backport of e949f44 from master
1 parent fa4b648 commit b2f7b51

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

docs/intro/tutorial02.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -512,11 +512,18 @@ template directory in the source code of Django itself
512512
print(django.__path__)"
513513

514514
Then, just edit the file and replace
515-
``{{ site_header|default:_('Django administration') }}`` with your own site's
516-
name as you see fit, e.g. ``{{ _('Polls administration') }}``. We use this
517-
approach to teach you how to override templates. In an actual project, you
518-
would probably use the :attr:`django.contrib.admin.AdminSite.site_header`
519-
attribute to more easily make this particular customization.
515+
``{{ site_header|default:_('Django administration') }}`` (including the curly
516+
braces) with your own site's name as you see fit. You should end up with
517+
a line like:
518+
519+
.. code-block:: html+django
520+
521+
<h1 id="site-name"><a href="{% url 'admin:index' %}">Polls Administration</a></h1>
522+
523+
We use this approach to teach you how to override templates. In an actual
524+
project, you would probably use
525+
the :attr:`django.contrib.admin.AdminSite.site_header` attribute to more easily
526+
make this particular customization.
520527

521528
This template file contains lots of text like ``{% block branding %}``
522529
and ``{{ title }}``. The ``{%`` and ``{{`` tags are part of Django's

0 commit comments

Comments
 (0)
0