Customizing Django Admin Landing Page

From Littledamien Wiki
Jump to navigation Jump to search

Configuring Grappelli dashboard[edit]

Create a stub Grappelli dashboard with

$ python manage.py customdashboard myproject/dashboard.py

Then edit the dashboard.py file to customize the arrangement of the Admin dashboard.

Custom display order of apps and models[edit]

Edit myproject/dashboard.py to override the default display of apps and models.[1]

self.children.append(modules.ModelList(
            title='Clients',
            collapsible=True,
            column=1,
            css_classes=('collapse open',),
            models=(
                'clients.models.Client',
                'contact_info.models.Person',
                'contact_info.models.Address',
                'contact_info.models.Email',
                'contact_info.models.Phone',
                'contact_info.models.State',
                'contact_info.models.Country',
            ),
        ))


Notes[edit]

  1. Dashboard API - Grappelli documentation