How to have 2 different admin sites in a Django project?

前端 未结 3 1621
终归单人心
终归单人心 2020-12-02 13:56

I want to have 2 separate admin sites inside a Django project.

By separate I mean - they should have separate users authentication, they should administer different

3条回答
  •  庸人自扰
    2020-12-02 14:34

    To register models in different AdminSites you just need to create different instances of django.contrib.admin.sites.AdminSite, see this.

    You will be good to go with two different admin sites managing different models and having different templates. For authentication and permissions you should be able to use the build-in django.contrib.auth as is with custom permissions (hope someone else will be able to help more here)

提交回复
热议问题