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:
Malcolm Tredinnick 2008-08-16 22:25:20 +00:00
parent a949f9ec7d
commit 7c6071861e
1 changed files with 7 additions and 8 deletions

View File

@ -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
admin index page.
By default, it displays all available apps, according to your ``INSTALLED_APPS``
setting. But the order in which it displays things is random, and you may want
to make significant changes to the layout. After all, the index is probably the
most important page of the admin, and it should be easy to use.
By default, it displays all the apps in your ``INSTALLED_APPS`` setting that
have been registered with the admin application, in alphabetical order. You
may want to make significant changes to the layout. After all, the index is
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
``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
uses a template tag called ``{% get_admin_app_list as app_list %}``. That's the
magic that retrieves every installed Django app. Instead of using that, you can
hard-code links to object-specific admin pages in whatever way you think is
best.
uses a template variable called ``app_list``. That variable contains every
installed Django app. Instead of using that, you can hard-code links to
object-specific admin pages in whatever way you think is best.
Django offers another shortcut in this department. Run the command
``python manage.py adminindex polls`` to get a chunk of template code for