Mohammad Tayseer
Mohammad Tayseer

Reputation: 509

Modify Django admin app index

I want to change the app index page so I add help text to the models themselves, e.g. under each model I want to add help text. I know that I should override AdminSite.app_index. What is the best way to do this?

Upvotes: 1

Views: 1653

Answers (1)

Mohammad Tayseer
Mohammad Tayseer

Reputation: 509

I can create a new AdminSite subclass, and override app_index method to send the help text to the template. In urls.py I can use an instance of MyAdminSite instead of django's vanilla AdminSite.

# urls.py
from mysite.admin import MyAdminSite
site = MyAdminSite()

urlpatterns = patterns('',   
    (r'^admin/', include(site.urls)),
)

# app/admin.py
site.register(MyModel)

Upvotes: 1

Related Questions