mirror of https://github.com/django/django.git
Fixed #8132 -- Updated tutorial 2 to describe the current way to customise the
main admin page. Based on a patch from julien. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8416 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
a949f9ec7d
commit
7c6071861e
|
@ -435,18 +435,17 @@ Customize the admin index page
|
||||||
On a similar note, you might want to customize the look and feel of the Django
|
On a similar note, you might want to customize the look and feel of the Django
|
||||||
admin index page.
|
admin index page.
|
||||||
|
|
||||||
By default, it displays all available apps, according to your ``INSTALLED_APPS``
|
By default, it displays all the apps in your ``INSTALLED_APPS`` setting that
|
||||||
setting. But the order in which it displays things is random, and you may want
|
have been registered with the admin application, in alphabetical order. You
|
||||||
to make significant changes to the layout. After all, the index is probably the
|
may want to make significant changes to the layout. After all, the index is
|
||||||
most important page of the admin, and it should be easy to use.
|
probably the most important page of the admin, and it should be easy to use.
|
||||||
|
|
||||||
The template to customize is ``admin/index.html``. (Do the same as with
|
The template to customize is ``admin/index.html``. (Do the same as with
|
||||||
``admin/base_site.html`` in the previous section -- copy it from the default
|
``admin/base_site.html`` in the previous section -- copy it from the default
|
||||||
directory to your custom template directory.) Edit the file, and you'll see it
|
directory to your custom template directory.) Edit the file, and you'll see it
|
||||||
uses a template tag called ``{% get_admin_app_list as app_list %}``. That's the
|
uses a template variable called ``app_list``. That variable contains every
|
||||||
magic that retrieves every installed Django app. Instead of using that, you can
|
installed Django app. Instead of using that, you can hard-code links to
|
||||||
hard-code links to object-specific admin pages in whatever way you think is
|
object-specific admin pages in whatever way you think is best.
|
||||||
best.
|
|
||||||
|
|
||||||
Django offers another shortcut in this department. Run the command
|
Django offers another shortcut in this department. Run the command
|
||||||
``python manage.py adminindex polls`` to get a chunk of template code for
|
``python manage.py adminindex polls`` to get a chunk of template code for
|
||||||
|
|
Loading…
Reference in New Issue