I currently have 2 admin.py files.
- project/admin.py
- project/pages/basicpage/admin.py
I would like to use the registered classes inside the second admin.py along with the first admin.py such that they can both be reached at the same admin endpoint.
FILE ONE: project/admin.py
from django.contrib import admin
from project import models
from project.pages.basicpage import admin as BP_admin
@admin.register(models.Test)
class TestAdmin(admin.ModelAdmin):
pass
FILE TWO: project/pages/basicpage/admin.py
from django.contrib import admin
from project import models
@admin.register(models.Platform)
class PlatformAdmin(admin.ModelAdmin):
pass
@admin.register(models.Type)
class TypeAdmin(admin.ModelAdmin):
pass
In file one, I have imported the second admin as BP_admin, not that it is used yet. However when I access my http://127.0.0.1:8000/admin endpoint, understandably I only can view the "Test" class that is registered in the first file. Any idea how to get my other 2 classes from my second file registered to the first file's endpoint?
Thanks!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…