Remove default apps from Django-admin

前端 未结 5 1722
無奈伤痛
無奈伤痛 2020-12-08 09:15

By default, in Django-admin there is Users, Groups, and Sites apps. How can I remove Groups and Sites?

I tried to remove admin.autodiscover() from root

5条回答
  •  执笔经年
    2020-12-08 09:56

    If you got:

    django.contrib.admin.sites.NotRegistered: The model Group is not registered

    Then make sure that your INSTALLED_APPS in proper order like this:

    enter code hereINSTALLED_APPS = (
    # [1] Django apps
    'django.contrib.auth',
    ...
    
    # [2] your custom apps
    'anyproject.anytuff',
    )
    

提交回复
热议问题