views:

251

answers:

1

good day!

by default, in django-admin, there is Users, Groups, ans Sites apps. How can i remove Groups and Sites? i was tried to remove admin.autodiscover() from root urls. Then, when i added smth like admin.site.register(User, UserAdmin) somewhere in my app models i got AlreadyRegistered exception (this is fairly right - models users already registered in django.contrib.auth )

+4  A: 

In an admin.py you know will definitely be loaded, try:

admin.site.unregister(User)
admin.site.unregister(Group)
admin.site.unregister(Site)
stevejalim
You will need to import them (or I did):from django.contrib.sites.models import Sitefrom django.contrib.auth.models import *
Vernon