I am trying to unregister for sites in django by doing the following:
from django.contrib.sites.models import Site
admin.site.unregister(Site)
However, this gives me a message that the "Site" is not registered (even if it appeared in the admins earlier).
If I try to do the following, I will not get errors, but the "Site" will remain in the admin panel:
from django.contrib.sites.models import Site
admin.site.register(Site)
admin.site.unregister(Site)
I need a site application and canโt get it out of the INSTALLED_APPS settings. However, the admin is completely useless to me. Any ideas on what I'm doing wrong here?
Thank!
source
share