Overriding the Index view of class AdminSite for Django admin?
I need to Ove开发者_开发百科rride the def index(self, request, extra_context=None):
view to perform some extra functionality but have no idea how/where do I make a class and inherit class AdminSite
and override the view to just perform extra functionality. I dont need anything else to be changed but just want to override this view.
Thanks Anks
I don't know the need to overriding or extending the admin index view
but i guess its fair to show something custom while showing the admin index page, If you want to add a couple of links of your own which looks neat and nice then django-admin-tools and django-grappelli will accomplish that. I've never tried it myself but there is a post i've seen few days back on google groups where a guy overrides/extends the admin index view with his own in admin.py
.
精彩评论