At the root page of the admin site where registered models appear, I want to hide several models that are registered to the Django admin.
If I directly unregister th
This is an alternative building on top x0nix's answer, and only if you are happy hiding the the rows with jquery.
Copy pasting from the other answer the part that I reused
class HiddenModelAdmin(admin.ModelAdmin):
def get_model_perms(self, *args, **kwargs):
perms = admin.ModelAdmin.get_model_perms(self, *args, **kwargs)
perms['list_hide'] = True
return perms
class MyModelAdmin(HiddenModelAdmin):
...
admin.site.register(MyModel, MyModelAdmin)
Then install django-jquery and then add the following block in your /admin/index.html
template:
{% extends "admin:admin/index.html" %}
{% block extrahead %}
{% if app_list %}
{% endif %}
{% endblock %}
You don't need to copy paste the whole template, just extend it and override the extrahead
block. You'll need django-apptemplates for the above to work.