35

How do I delete the model groups admin page? I want to show that by default, the group model. Thank you very much in advance.

2 Answers2

65

Use the unregister method :

Add to the admin.py file :

from django.contrib import admin
from django.contrib.auth.models import Group

admin.site.unregister(Group)
pistache
  • 5,782
  • 1
  • 29
  • 50
yasaricli
  • 2,433
  • 21
  • 30
6

You need to check the order of INSTALLED_APPS in settings.py. Basically, your app should be listed after the django.contrib.auth.

Use the following code to unregister the Group inside admin.py file of your app:

from django.contrib.auth.models import User

admin.site.unregister(Group)
Pedram Parsian
  • 3,750
  • 3
  • 19
  • 34