Admin注册和路由分发详解 1.启动 #autodiscover_modules('admin', register_to=site) 2.注册 1.单例对象 admin.site = AdminSite(): 单例对象 AdminSite 源码: class AdminSite(object): def __init__(self, name='admin'): self._registry = {} def register(self, model, admin_class=None, *…