diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2013-09-06 12:31:44 -0500 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2013-09-06 12:31:50 -0500 |
| commit | a962286b74f1e8c8cb19fb45a057800da8c2fb56 (patch) | |
| tree | bb2fef0e60734abc60b8f6ef8b9aa65ef7ec7a42 /docs | |
| parent | 273a1e6b8d42f9c0d2ff8ad88eedbc83ae3ee12b (diff) | |
Added AdminSite attributes for easily changing admin title.
AdminSite now has overridable site_header, site_title and index_title attributes. Changed
each admin view to pass these to the context (in a new AdminSite.each_context() method).
The intent here is to make it easier to override these things in the common case, instead of
having to override a template, which is a bigger burden.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index ba5fa3bff6..4a96d73604 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -2162,7 +2162,7 @@ creating your own ``AdminSite`` instance (see below), and changing the Python class), and register your models and ``ModelAdmin`` subclasses with it instead of using the default. - When constructing an instance of an ``AdminSite``, you are able to provide + When constructing an instance of an ``AdminSite``, you can provide a unique instance name using the ``name`` argument to the constructor. This instance name is used to identify the instance, especially when :ref:`reversing admin URLs <admin-reverse-urls>`. If no instance name is @@ -2174,6 +2174,21 @@ creating your own ``AdminSite`` instance (see below), and changing the Templates can override or extend base admin templates as described in `Overriding Admin Templates`_. +.. versionadded:: 1.6 +.. attribute:: AdminSite.site_header + The text to put at the top of each admin page, as an ``<h1>`` (a string). + By default, this is "Django administration". + +.. versionadded:: 1.6 +.. attribute:: AdminSite.site_title + The text to put at the end of each admin page's ``<title>`` (a string). By + default, this is "Django site admin". + +.. versionadded:: 1.6 +.. attribute:: AdminSite.index_title + The text to put at the top of the admin index page (a string). By default, + this is "Site administration". + .. attribute:: AdminSite.index_template Path to a custom template that will be used by the admin site main index |
