The Django admin page has 'Sites' as a default object.
This is confusing to users, as my application also has a 'Site' model accessible through the admin page.
How can I remove the default object from the page?
The Django admin is a powerful built-in tool giving you the ability to create, update, and delete objects in your database using a web interface. You can customize the Django admin to do almost anything you want.
Take a look at the Model Meta in the django documentation. Within a Model you can add class Meta this allows additional options for your model which handles things like singular and plural naming. Show activity on this post. inside model.py or inside your customized model file add class meta within a Model Class.
You can unregister default models in admin.py of your app by using unregister . You need to import Attachment from summernote to works.
If you open a Django project's urls.py file, in the urlpatterns variable you'll see the line path('admin/', admin. site. urls) . This last path definition tells Django to enable the admin site app on the /admin/ url directory (e.g. http://127.0.0.1:8000/admin/ ).
use unregister
:
from django.contrib import admin from django.contrib.sites.models import Site admin.site.unregister(Site)
I usually put this after the:
admin.autodiscover()
in urls.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With