Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you add a custom section to the Django admin home page?

In the Django admin each app you have registered with the admin gets its own section. I want to add a custom section for reporting that isn't associated with any app. How do I do that?

like image 891
Jason Christa Avatar asked Aug 28 '09 18:08

Jason Christa


1 Answers

To add a section not associated with an app, you'll have to override the admin index template. Create an admin/ directory in your project templates directory, and copy the file django/contrib/admin/templates/admin/index.html into it. Then you can add whatever markup you want to this file. The only downside (unfortunately there's no good way around it at the moment) is that if you upgrade Django, you'll have to be on the lookout for any changes to that index.html file, and copy those changes over into your version as well.

like image 128
Carl Meyer Avatar answered Oct 16 '22 19:10

Carl Meyer