News for hackers. Stuff that matters.
Re:Ask HN: Why aren't Django Admin style dashboards popular ... by mdasen on Saturday October 28, 2023 @12:10PM (#38050913)
It's probably a combination of things.

The Django Admin existed before Django publicly existed. That meant that once anyone started using Django they knew that they should constrain their use of Django in certain ways so that the Django Admin would work with their usage. Features that would be added to Django would be built with the Django Admin in mind.

Many tools like Flask or FastAPI don't have an opinionated model layer like Django. Without that, you can't really create an admin interface programatically. People could be storing their data in any sort of fashion anywhere. How would one build an admin system for something like Flask or FastAPI where there's no convention around how people set up data access? A lot of frameworks out there don't tell you "access your data in this way" or "this is how users will be authenticated." Without those two things, it's hard to really create an admin system.

There are similar systems available for some frameworks, but since they aren't part of the core framework, they don't get the same attention. Someone creates it, but it doesn't have the kind of community buy-in that sustains it. One of the odd things about Django is that the admin system is under `django.contrib` which indicated that they didn't intend for it to be in the core of Django forever, but that's not really how `django.contrib` ended up. It continued to be a core part of Django maintained as part of the framework.

Like I said, there are admin dashboards available in other frameworks like RailsAdmin (https://github.com/railsadminteam/rails_admin) or Core Admin for .NET (https://github.com/edandersen/core-admin) and I'm sure there's more. However, both Rails and .NET provide most of what Django provides (and a lot more than most frameworks). Rails and .NET both have a default data access ORM that a majority of people using those frameworks tend to use. .NET has built-in authentication/authorization so the admin can work off that. Rails doesn't have auth, but RailsAdmin uses some plugins.

There's even Flask-Admin: https://flask-admin.readthedocs.io/en/latest/. However, if you start reading through the docs you start seeing that you have to solve more than just dropping it in. How do you do auth and permissions? Have you used SQLAlchemy, MongoEngine, PeeWee, or PyMango to access your data? No? Well, you might need to write a way for it to actually figure out your data. Because Flask apps aren't generally written with Flask-Admin in mind and because Flask doesn't offer a default path for things like models and auth, it becomes a harder and more varied task to create a generic admin system.

Re:Ask HN: Why aren't Django Admin style dashboards popular ... by stuartjohnson12 on Saturday October 28, 2023 @12:17PM (#38050977)
I'm trying to figure this out, or understand if this is moment to try and do something about it. This seems like such a common use-case but the offerings across frameworks are all fragmented and sad. We're at a scale now where Django Admin is creaking and the lack of extensibility is killing us - for example, we'd love to build actions that work based on specific form inputs rather than just the standard atomic bulk actions that Django Admin supports. We've tried some experiments to do this and it's rapidly looking like doing this at any kind of scale is going to turn us to mud.

While I was looking for something for us to upgrade off of Django admin to, it seems like the main presence here is something like ReTool or Airplane.dev. The common consensus in these tools seems to be that the way to build admin dashboards in a framework-agnostic way is to build drag'n'drop interfaces and then have lots of little individually deployable scripts which run SQL queries.

This seems like such a sad state of affairs. Do you know of any tools that are able to cope with data storage agnosticism in a way that feels more like software engineering?

Re:Ask HN: Why aren't Django Admin style dashboards popular ... by mdasen on Saturday October 28, 2023 @12:52PM (#38051333)
I think you've kinda hit why systems like the Django Admin aren't more common. At some point you simply need to build custom code. I've seen engineers spend so much time futzing with the Django Admin trying to contort it to their use case when they could have just built their own form in a fraction of the time.

I was going to question the "tremendous value of Django Admin", but I thought I shouldn't. I was going to say something along the lines that it creates this mediocre form inputs so that backend engineers don't have to write an HTML form and they can ship something to their users without having to touch the front-end. However, I actually do agree that there is a good amount of value in the Django Admin. Having a mediocre UI to touch the data is really valuable. I think the problem is that you start thinking it should be the only UI for touching the data.

The solution to your problem might be creating something custom with some utilities. What does the Django Admin offer you? A way of displaying a table of data? A link to a form to update that data? You could build what you need.

I'm not sure what you're looking for in terms of something "that feels more like software engineering." I don't even know what your use case is for the Django Admin. Are you a shop doing lots of small projects for clients so you need a way for them to edit the data that looks passably professional while taking the absolute minimum of dev time? Are you creating a single product and maybe you should just spend a little bit more time on data access? Why do you want something that "feels like software engineering?"

At some point, there might be cases where you simply need custom stuff for certain things.

Re:Ask HN: Why aren't Django Admin style dashboards popular ... by stuartjohnson12 on Saturday October 28, 2023 @01:01PM (#38051437)
I think what you're calling mediocre is precisely the same thing I was calling tremendous - the fact it allows us to ship mediocre form inputs with complex programmatic validation and permissions without the need to touch a line of frontend is indeed pretty great.

The use case is https://spotdx.com. We're a YC backed healthtech product with a significant amount of need for safe manual data entry and updates, and the requirements for that data entry evolves semi-frequently. Compared to a traditional frontend framework (say, React), Django Admin drastically slashes the amount of engineering resources needed to ship new kinds of mediocre form input. The way we work at the moment doesn't require a frontend engineer at all to get new internal stuff done.

There's a lot of cool work that has been done across various frameworks to put CRUD interfaces of varying complexity on top of an ORM, but it all seems so repeated and fragmented, and varies wildly in quality between frameworks. I wish there was a tool like ReTool that was tied to our regular backend and ORM.

We do use React for other parts of our product, but avoiding it here is handy.

Re:Ask HN: Why aren't Django Admin style dashboards popular ... by mdasen on Saturday October 28, 2023 @02:53PM (#38052382)
Mediocre might not have been the right word. I think we really don't have a word for "it's nothing great, but because the cost is almost nothing it kinda is great." Like I said, it is great because it lets everyone touch the data with almost no effort. However, it's not great because you can end up bumping against limitations that will happen with basically anything pre-made.

You're right: the other tools often aren't amazing and part of that is because critical mass makes things better. The fact that the Django Admin is so common in the Django world means that it gets exposed to many different use cases and things work pretty well with it.

To take a step back, some of this is the framework vs. library debate. With a framework, you're getting libraries where the edges between the libraries have been smoothed over and there's a certain assurance that things will work together well. With a library, it can be a very high-quality library, but it can feel like it doesn't quite work with your stuff. Part of that is that it's hard to anticipate everything people will do.

I am curious what you like about ReTool and what you don't. It sounded like you wanted something that felt more like software engineering than like ReTool's low-code drag-and-drop experience, but maybe I'm wrong. In terms of being integrated with your regular backend and ORM: is the point that you want it (for example) to be able to re-use filters you've already set up in a model and therefore if you update those filters in the future, you don't have to also update them in whatever query ReTool is using?

I think part of the issue is that the Django Admin serves what most people need and once they go beyond that, they'll just hook in a tiny bit of custom stuff. I haven't used Django since before the pandemic so I don't remember everywhere you can hook into the admin system, but I kinda remember being able to being able to create custom pages in `admin/model-name/custom-view-name.html` and then being able to do a custom view that used the Django auth (https://docs.djangoproject.com/en/4.2/topics/auth/default/#t...). Maybe the answer for the bulk stuff is simply doing your own list-view for the occasions you need it. For example, if you want to have a form field that's like "Update all names to what's in the box", you could just override the template for that model, create a little form at the top, have it submit to a custom action within the admin that does the work, and then redirects back. Again, it's been a while since I've used Django, but you can always extend things like `django.contrib.admin.views.main.ChangeList`. I also don't completely understand your use case because we're just having a very small conversation on HN so my comment might be completely off base. But I remember just extending the existing Django stuff and overriding stuff.

I'd also say that sometimes it can be helpful to take a step back and think if there's a different way of getting to where you're trying to go. If there's something that you need that happens kinda rarely, you can always create a new page within the section for that model and then have a link to that page. Then just do custom stuff there. Are your requirements that go beyond what the Django admin can do something that you're running into constantly or something that's blocking you on a couple of tiny edge cases? If it's the latter, maybe stuff a custom Django admin view in a couple places.

Ultimately, I think the issue is that open source often stops at a certain point. Tools like ReTool are built to scratch a different itch: the itch for enterprise businesses that want a low-code solution and are willing to pay someone to abstract a lot of stuff. In the open source world, things often stop way short of what the Django admin offers - heck, that's the entire thesis of your initial post. It's hard to create good, general tools because everyone wants something slightly different and you end up building your own mini-programming language as it gets general enough. The companies/people who try to go that route are generally targeting enterprise executives and not software engineers. But I certainly understand wishing that the Django Admin just did things a little different or a little better.

Re:Ask HN: Why aren't Django Admin style dashboards popular ... by ruslan_talpa on Sunday October 29, 2023 @01:58AM (#38056133)
If by backend you mean your db (and not your python/rails code) and you want django admin functionality but with react on the frontend, check out https://subzero.cloud (ts lib), i am building it
Re:Ask HN: Why aren't Django Admin style dashboards popular ... by hdoan741 on Monday October 30, 2023 @01:33PM (#38072673)
> I wish there was a tool like ReTool that was tied to our regular backend and ORM.

Hi from Retool! I'm working on an exact solution for this problem. We're building a backend & ORM integration that will enable you to connect your ORM with Retool directly to build admin dash & flexible tools on top of it. It's beta but please let me know if you would like to give it a try!

Re:Ask HN: Why aren't Django Admin style dashboards popular ... by ruslan_talpa on Sunday October 29, 2023 @01:43AM (#38056069)
I am building https://subzero.cloud

If your data is in pg/mysql/sqlite/clickhouse this might work for you

That is for js/ts stack

Re:Ask HN: Why aren't Django Admin style dashboards popular ... by ruslan_talpa on Sunday October 29, 2023 @01:47AM (#38056081)
Unlike retool, you almost never need to touch backend because the system already provides 90% of your needs just by introspecting the database, you only implement super custom endpoints where you need custom complicated queries or you need to call 3rd party systems