I'm trying to create a documentation part in my admin panel, and for that I created a custom admin site. I've overriden the get_app_list and get_urls methods in order to display a new line in the navigation bar and the dashboard, and I created a view to which this line redirects :
class MyAdminSite(admin.AdminSite):
def get_app_list(self, request):
app_list = super().get_app_list(request)
app_list += [
{
"name": "Documentation",
"app_label": "my_test_app",
"models": [
{
"name": "Scripts modification",
"object_name": "Scripts modification",
"admin_url": "/admin/documentation/modif/",
"view_only": True,
}
],
}
]
return app_list
def get_urls(self):
urls = super().get_urls()
my_urls = [
path('documentation/modif/', self.admin_view(self.modif)),
]
return my_urls + urls
def modif(self, request):
context = {
'title':"Documentation",
}
return render(request, "documentation/scripts_modification.html", context)
Everything works correctly and when clicking on the new line, I'm redirected to the new view I created. However, I want my view to have the same design as the rest of the admin panel, which I didn't how to do.
I extended admin/base_site.html but I only get the top of the page, and not the view site log out panel nor the navigation sidebar :
I have no idea what I should change/configure in order to have the same display as the other admin pages. Shouldn't extending base_site.html display what I want ? There's something I didn't really understand here and I can't find what nor where to learn about it.
