5 ms·
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
by mdasen 3y ago
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.
- stuartjohnson12 3y agoI 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 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.
- mdasen 3y agoMediocre 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/#the-permission-required-decorator 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.