main admin.py file

hello,
I have 3 models: Product, Category, Album and a custom admin model to each of them.

If I add this line in the end of each admin.py file the program works ok (Category example):
admin.site.register(Category, CategoryCastumAdmin)

But then it shows them on my website in the order I created the apps (or idk):
django_tables_order

And I want for example for the products to be the first and after category,
I tried to remove the admin.site.register from every admin.py file and put it in a new file:
my_project/admin.py (next to my settings.py file) but this file is not running, how can I make django run this file? or any oher way to do this?

I’d come back to the more fundamental question - Why do you think it’s important to do this?

If it’s because you’re going to expose the admin site to anyone other than a system admin, then I’d say you’re trying to use the Django admin in a way it’s not really intended for use.

From The Django admin site docs -
The admin’s recommended use is limited to an organization’s internal management tool. It’s not intended for building your entire front end around.

Yes, you can probably dig around into the admin internals and reorganize how this page works - but I’d suggest you’re getting to the point where it would be a whole lot easier to just create your own views.

1 Like