I would like to request some assistance regarding this matter.
I have followed this guide to add a view to my admin.
I am using the same code that the site has a
This guide looks quite old. I would rather advise you to follow django docs.
someapp/admin.py
from django.contrib.admin import AdminSite
from django.http import HttpResponse
class MyAdminSite(AdminSite):
def get_urls(self):
from django.urls import path
urls = super().get_urls()
urls += [
path('my_view/', self.admin_view(self.my_view))
]
return urls
def my_view(self, request):
return HttpResponse("Hello!")
admin_site = MyAdminSite()
Source: https://github.com/django/django/blob/2.2/django/contrib/admin/sites.py#L194-L205
You should also update your project/urls.py and replace path('admin/', admin.site.urls) by path('admin/', admin_site.urls). Don't forget to from someapp.admin import admin_site before.