Fixed #23587 -- Clarified admin template overriding in tutorial 2.
Thanks Petrus van Bork for the report.
This commit is contained in:
parent
0eccf8fbea
commit
e949f4435f
|
@ -512,11 +512,18 @@ template directory in the source code of Django itself
|
||||||
print(django.__path__)"
|
print(django.__path__)"
|
||||||
|
|
||||||
Then, just edit the file and replace
|
Then, just edit the file and replace
|
||||||
``{{ site_header|default:_('Django administration') }}`` with your own site's
|
``{{ site_header|default:_('Django administration') }}`` (including the curly
|
||||||
name as you see fit, e.g. ``{{ _('Polls administration') }}``. We use this
|
braces) with your own site's name as you see fit. You should end up with
|
||||||
approach to teach you how to override templates. In an actual project, you
|
a line like:
|
||||||
would probably use the :attr:`django.contrib.admin.AdminSite.site_header`
|
|
||||||
attribute to more easily make this particular customization.
|
.. 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 %}``
|
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
|
||||||
|
|
Loading…
Reference in New Issue