Search code examples
djangodjango-admininternal-server-errorattributeerrordjango-admin-actions

Removing(unregistering) a section from django admin page


From the django admin page, I wanted to remove a section of an app. At first, the admin.py had this contents:

admin.site.register(MyUser)

So I changed it to be:

admin.site.unregister(MyUser)

and it caused Internal Server Error.

What should I do to remove the section of account app from the admin page?


Solution

  • Just don't register you model in admin.py and it will be "removed" from admin page. Comment or delete this line instead of changing it:

    # admin.site.register(MyUser)