admin文件
from .models import Epic, Event, EventHero, EventVillain
from django.contrib.admin import AdminSiteclass EventAdminSite(AdminSite):site_header = "Events管理"site_title = "欢迎您!"index_title = "管理员"event_admin_site = EventAdminSite(name='event_admin')event_admin_site.register(Epic)
event_admin_site.register(Event)
event_admin_site.register(EventHero)
event_admin_site.register(EventVillain)
urls
from django.contrib import admin
from django.urls import path
from Events.admin import event_admin_siteurlpatterns = [path('entity-admin/', admin.site.urls),path('event-admin/', event_admin_site.urls),
]
显示效果: