I want to add custom views and templates to Admin and wrote this:
# in models.py
class MyAdminSite(admin.AdminSite):
def my_view(self, request):
return HttpResponse("Test")
def get_urls(self):
from django.urls import path
urlpatterns = super().get_urls()
urlpatterns += [
path('my_view/', self.admin_view(self.my_view))
]
return urlpatterns
admin.site = MyAdminSite()
# and in apps.py
class MyAdminConfig(AdminConfig):
default_site = 'ToDoDashboard.admin.MyAdminSite'
I have registered all the models and I see them in my custom Admin panel. However, the section with users and groups has disappeared. How to get it back?