Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding reports to Django's admin

I'm looking to add an extra set of pages to my auto-generated admin site. I want to generate reports off my models and some logs surrounding it. The actual generating isn't the issue.

How do I:

  1. Make the report output look like it's an admin page, with breadcrumbs, similarly formatted table, etc?
  2. Register the view so it shows up on the front page?
like image 889
Oli Avatar asked Jan 28 '09 21:01

Oli


1 Answers

The above answer didn't address question 2, at least directly... the "hack" way to get your custom view to show up as the front page of the admin is probably to just override it in the urlconf:

(r'^admin/$', my.custom.admin.homepage),

before the normal admin line:

(r'^admin/', admin.site.root),

the "right" way to do it, though, is to make your admin a custom instance of AdminSite and override the index_template setting. http://docs.djangoproject.com/en/dev/ref/contrib/admin/#root-and-login-templates

like image 177
Yoni Samlan Avatar answered Sep 18 '22 01:09

Yoni Samlan