PROJECTS NOTES HOME

Valid points for not using django-admin as a primary UI for your project

1 Offcial Django docs

https://docs.djangoproject.com/en/5.0/ref/contrib/admin/

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.

If you need to provide a more process-centric interface that abstracts away the implementation details of database tables and fields, then it’s probably time to write your own views.

2 Django forum

https://forum.djangoproject.com/t/understanding-the-django-admin/28151

Yes, you can spend a lot of time learning about how to customize the admin. However, what I have learned over the years is that in the time you’ve spent learning how to do this, you generally could have completed your project twice-over by ignoring it. I’ve seen this mistake made in a number of cases, and I know others who have encountered the same problem. Just like you describe - the admin is deceptively simple to get something up and running. But as additional features and functionality are requested, you find yourself working more and more around the limitations of the admin. Soon, you reach a point where you’re spending far more time trying to figure out how to get the admin to do something than actually doing it. What you end up with can quite frankly be described as a generally-unmaintainable mess. So what I really suggest is the same thing that the authors of Django recommend. Don’t do this. If you’re lucky and stay with Django long enough, you’ll realize how much of a mistake this can be.

The fact that a bad decision was made in the past does not justify continuing to make that same bad decision today.

As a professional, it’s also your responsibility to identify these mistakes and to demonstrate that there are better ways of handling this.

Sure, you can do this. But I’m going to continue to express my opinion here that it’s fundamentally a poor idea. The “Technical Debt” you create by focusing everything through the admin can be amazingly substantial.

The “two-years-from-today-you” will thank you.

3 Reddit

https://www.reddit.com/r/django/comments/587gvr/django_admin_is_really_slow_any_thoughts_on_how/?rdt=50786

We use the django admin to manage tables with upwards of two million rows. There are some tricks. All foreign keys must be read only. You shouldn't be using the admin to control selections from tens of thousands of things. It just isn't a reasonable interface. You could make it work for quite a while with prefetch_related. You could make it work forever with a custom ajax autocomplete. But you should probably consider not using that interface in the admin and doing it in a view that you have full control over the UX.

4 Knowledge from Django podcast

"Jacinda's PyCon talk is a good one. I saw it in person so it made a big impression at the time. Kenneth Love has a 3-hour tutorial all about the admin. And Jacinda also has an earlier 3-hour talk on the admin."

There are multiple Django talks about abusing the admin. 41:06 - https://open.spotify.com/episode/1JeC5GruYeqYsjNpegrOxI?si=1GodW0zVTYmQfqJwWhFfRQ&t=2466

2min back - https://open.spotify.com/episode/1JeC5GruYeqYsjNpegrOxI?si=vhg_HKbISLa9QKA9FTQN9w