Ask HN: Why aren't Django Admin style dashboards popular in other frameworks?

34 points by stuartjohnson12 ↗ HN
We're a Django shop and we get tremendous value out of Django Admin. Most python-heads I know suggest Django Admin as a major reason to go with Django over flask or FastAPI. Beyond that, I don't think there's a clear equivalent in another language either. My question is this:

Why has Django Admin proliferated so strongly in the Django ecosystem while being unreplicated elsewhere?

85 comments

[ 2.7 ms ] story [ 138 ms ] thread
ActiveAdmin in rails
My team has gotten bitten by ActiveAdmin a few times in the past. We've switched to Avo and it's been an absolute wonder.
Mostly because it is dangerous (or was). For example, an integer that can only be 1, 2, or 3. In the admin (way back in the day, at least), someone could go into the admin and set it to 4. Which would then break everything in subtle ways.

Also, most applications have constraints like "X can only be 2 if and only if Y is equal to Z" ... there was no way to specify that constraint to the admin interface, so someone could set X to be 2, and it would break programmer assumptions who wrote code expecting Y to be equal to Z.

I don't know Django but doesn't model validation apply to the admin screens?
It does but in general there’s less insistence (as compared to Rails, for example) to have “smart models, dumb controllers” - therefore in Django a lot of business logic can end up in the controller and thus doesn’t apply in the admin.

This is a convention though - one could just as easily do it the other way and embed all the business rules in the models.

It used to not be IIRC. This was over a decade ago, so my information is likely outdated, but it might explain why other languages chose not to implement it. Further, a model may be valid, but make no sense to an application. For example, a car may have 6 wheels and still be a car ... but might be out-of-bounds for a simulation expecting 4 wheels.
I can confirm you can do this validation now, but it's not super-super easy.
Must have been well over a decade because Django models have had deep integration with the form validation API since I started my career.
yes it does if implemented correctly with that intention in mind
I think you can can still have those checks as pre_saves in your models
if your model is a choicefield, then it only shows you those values and you can’t do what you are describing. Additionally, you have validation that can happen at the class level, group of fields, or field.
This is very out-of-date. Easily adding validation has been a key benefit of the Django admin for more than a decade at this point.

(You still have to do the work, but if people are breaking things through the admin that's your fault.)

Nova in Laravel. https://nova.laravel.com
Not free or baked in.

It's decent overall, but I think filament and orchid are overall a better value. Both because they're free but feel a bit easier to work with, and seem to have faster-growing ecosystems.

I think it has to do with the times. Because sl admin came up in a pre DRF time when people use Django to serve templates, the work to build it into the framework came more naturally. With lots of more modern web app frameworks mainly focusing on just being APIs for single page applications, having html templates and stuff in the core project and having contributors build this stuff in doesn’t happen as naturally.

I totally agree though- huge selling point of Django!

Counter point: I actually use DRF and the Django Admin. They're not really at competition with each other.
(comment deleted)
Can you clarify what's the "tremendous value" you're getting out of the Django admin?

At Heii On-Call https://heiioncall.com/ we are using Active Admin https://activeadmin.info/ for Ruby on Rails, which seems quite similar to the Django admin. In my experience, it's mostly useful as a fairly basic read-only view of what's in the database. In Rails, it's so easy to whip together a custom view that we tend to do that, and the Active Admin is nice to have but I wouldn't say "tremendous value".

The value in the Django admin is much more about data entry than purely read-only data access.
Totally agree.

I recently dabbled a bit in stock picking, and built a system to record my commentaries on stocks and my subjective valuation, so that I can refer to them later (so that I have something to base my trades on other than pure emotion).

I just defined the models and used the admin interface for all the editing. I mean, in theory it's not much different from using an excel spreadsheet to keep my records, but I get a full SQL database and a customizable webUI for free after I defined my models. And if I need anything fancy I have a fully programmable system that I can extend arbitrarily.

In django, as long as the functionality is only exposed to trusted users (hence it's called "admin"), there's very little reason to write any "views" logic after you defined the model and basic controller logic.

It's basically the generic CRUD app that you don't have to write.

As soon as you need frontend auth you'll regret going with flask or fastapi. There is no equivalent in the python world for django admin
Can you elaborate? Both Flask and FastAPI support various authentication methods.
None of them matches the out-of-the-box functionality of django for a classic saas app. You're constantly reinventing the wheel to get a production-ready user & auth workflow.
It’s mostly just a UI for CRUD. And most systems are more complex, requiring UIs that operate on business logic.

Rails and Phoenix also offer similar features (called scaffolds), but they are optional. I’m sure other frameworks have similar options.

Meanwhile, Django (like Python) sometimes has unconventional names and approaches to doing common things, so that makes the pair unpleasant and awkward for those of us with experience with several other tools and frameworks.

> most systems are more complex

Citation needed. We also have got a _lot_ of mileage out of it over the years.

Ok, how complex are _your_ systems? Simple table views are available through a number of database management software (dbeaver). What does django provide beyond that?
What do you think is missing – your broad claim was made authoritatively enough that I’m assuming you had bad experiences somewhere?
(comment deleted)
(comment deleted)
You can customize the admin so it only shows some tables, you can add actions that run things in the backend, the changes go through your Django models so they run validation etc.

In short you really can give it to knowledgeable admins at customers to configure and admin applications with, in a way that you can't just let them edit database tables.

(comment deleted)
This is kind of the point. Built in interfaces require tuning to fit a given situation. And the alternative is a starter/scaffold generated on demand and then extended, or just a fully custom built solution (which, if one’s design is good and the framework is good, is low effort).

As with all frameworks, the freebies usually have less value in real world situations than we imagine they would.

So choosing a framework based on the freebies is extra risky.

The Django admin is much more about data entry than viewing tables.

A few key features in terms of data entry:

- custom data validation

- ability to edit foreign key and many-to-many relationships, with optional search

- inline editing of related items

- file uploads

- custom "actions", where you can select a bunch of rows at once and then run custom logic to process them in some way

It is not just a UI just for CRUD. You can easily add custom actions (calls to web services, export/imports, heavy background tasks that operate on a row or collections of rows), filters, related tables with custom behavior, display custom derived/calculated values, etc. Additionally, you can skin it easily - and in some cases, even create dashboards in a very simple manner. Check out out Django Unfold for an example https://github.com/unfoldadmin/django-unfold
Of course it’s possible to customize and extend, just as with other frameworks it is possible. We aren’t talking about closed systems here.

Even writing a fully custom “admin” interface for one part of a business process isn’t usually much work if the system itself (which Django would also depend on) is reasonably designed.

Writing something from scratch isn’t that difficult, and you get exactly what you need without fighting against the framework.

You can perfectly do business logic operations through the django Admin. It's extensible, and doesn't require a lot of effort to set it up.
I never suggested it was not extensible in Django.

But whether starting from a scaffold of another framework or building entirely custom, the effort in making custom, complex admin interfaces isn’t difficult.

As with most software systems, the biggest part of the work is dealing safely with end users. Admin interfaces can be simpler because of this, and therefore they are less effort to make.

Admin for Symfony Framework ( PHP )

https://symfony.com/bundles/EasyAdminBundle/current/index.ht...

Admin for Laravel (PHP) https://nova.laravel.com/

Java Spring Boot https://docs.spring-boot-admin.com/current/getting-started.h...

I think many other Frameworks have this, did you search for it?

The Spring one linked above is not really comparable to Django admin in my opinion. In particular it doesn’t integrate with your data model at all - it essentially just shows actuator endpoints.
Right, it describes itself as "Spring Boot Admin is a monitoring tool".
Phoenix has Kaffy: https://github.com/aesmail/kaffy

Super-simple to set up and it's been perfectly adequate for my app's needs so far.

To answer OP's original question: Django Admin isn't a killer feature because the same kind of thing is available for most other Django-like frameworks, with the only difference being that it's usually a third party library rather than something built into the framework itself.

Being built into the framework is a big deal, though.

The problem with third-party libraries for this kind of thing is that there's no guarantee that they will be maintained in lockstep with the underlying framework.

What if they get abandoned? Or a new version of the framework comes out with new features but the third-party library takes months to add support for them?

I think this may be an aspect of Django that isn't appreciated nearly as much as it should be: batteries included means that the feature you depend on are guaranteed to be maintained and documented at the same pace as the rest of the framework.

Filament is better and free, for Laravel
It's hard to do well, especially if the framework isn't built from the ground-up to meaningfully model database schemas. It basically involves creating a CMS which is a project in of itself. Do you stop at building Django or do you keep going until you have created Wagtail? There's a ton of value in it, but it's tough.
It's hard to automatically generate a useful admin dashboard like this in a framework that's not oriented around crud apps with certain assumptions baked in.

Most frameworks/platforms that are oriented around crud apps, where the framework itself does have a concept of models, do have some sort of admin dashboard feature.

Flask is a microframework that doesn't make assumptions about any database/models, so it's impossible for it to do something like this.

However, there is arguably a limited range of apps where an automatically generated admin dashboard is going to be useful anyway.

> Why has Django Admin proliferated so strongly in the Django ecosystem while being unreplicated elsewhere?

It's useful when I start a project, but if that project matures I generally replace it with something tailor made to the application. In other languages and framework I end up building an admin panel too, just in Django I end up doing that later in the process.

Replicating the Django admin is tough too. It's made to be highly generic and it remains stable release to release. Any project seeking to replicate that would need to replicate Djangos abstraction model in order to achieve any kind of stability like the Admin view has.

I love the Rust language and tooling, but don't use it for web dev because it lacks something like Django. I build web backends in Python because of Django. Not exclusively because of admin, but that's part of it. (Other parts include built in DB auto migrations, auth, email, templates, [de]serialization, tightly-integrated ORM etc)

I can't figure out the intended workflow for using the Rust frameworks. When I ask (eg rust webdev communities) how to build a website using them, I get no responses, or comments about how Diesel is better than Django's ORM.

It seems more doable with Flask etc in Python because of the robust ecosystem of third-party addons, but it still seems like a complexity trap due to potential mutual incompatibilities between them.

The admin page in particular is excellent for debugging, changing config, quick queries etc.

I've been out of web development for about four years now, but I think Django is unusual in providing the admin dashboard for free. Most frameworks don't want to devote the resources to that when there are third-party options you can fairly easily (ha ha) bolt on to your project. Speculatively, it may be that Django comes from a time before such a wide variety of self-service solutions existed, and based on the newspaper use case they built the framework to support, they felt like it was worth the time to do it.
We originally created Django as a CMS for some newspaper websites. We didn't even think of it as a framework - we called it "the CMS" for the first ~10 months that we were working on it.

https://simonwillison.net/2010/Aug/24/what-is-the-history/

I'm curious how you think about Django's CMS capabilities compared to less opinionated languages and frameworks. Do you think the fact that Django is so opinionated is necessary for Django to be as good as it is? If Django was built more like FastAPI could something like Django Admin still work? Is Django Admin special because of the execution, or because of the capabilities that the design of Django enables it to have?
Personally I think it's mainly down to the fact that the ORM and admin were designed together, with the intention of supporting the subset of operations needed to build a CMS.

That's one of the reasons it doesn't support things like compound primary keys very well - it turns out you don't really need those for the common CMS subset of functionality.

What third party options would you recommend? I'm aware of ReTool and Airplane.dev, but both of them feel like I'm a technician fighting an interface and not a software engineer writing functionality.
(comment deleted)
I'm from Retool and I agree with you a lot of things we can do better. IMO Retool is best as a simple way to build UI with drag-n-drop. For actual business logic, it should be left written in your own backend, and we can do better in connecting the two. We're working on a solution for this, which will allow you to connect Retool UI to your backend & ORM directly. LMK if you're interested in trying it out!
Keeping in mind I'm referring to Django years ago, as I dont know how many of these limitations have since been lifted, the Django admin was able to be successful because Django itself only allowed a narrow subset of database constructs to be modeled in the first place. You had tables with single-column primary keys only, and then you had simple one to many, many to one, many-to-many, and their "generic foreign key" thing, and IIUC that was it. This narrow band of possible database configurations made it easier to put an admin on top of (and also to generalize into DB migrations).

There are "django-admin" style tools for SQLAlchemy (or at least there were, back when people had the notion that "the Django admin" was why Django was successful), but they have a hard time being able to generalize to SQLAlchemy's capabilities for things like table inheritance, custom join conditions, composite keys, etc. Our users, when they build out their database schemas, are throwing the whole kitchen sink in there and producing a much more personalized kind of product that does not lend itself as well to a generic CRUD gui. Nor do a lot of SQLAlchemy users really want such a thing, since they will have these very particular types of models with lots of nooks and crannies that they'd prefer to code up themselves.

The SQLAlchemy approach is a lot more schema oriented whereas the Django one strikes me as intentionally narrowed for simplicity.

> Beyond that, I don't think there's a clear equivalent in another language either.

Filament seems promising for folks working with Laravel:

https://demo.filamentphp.com/

I don't think it's quite there yet though. It's pretty slow.

I recently built a Filament application and have a few thoughts.

1. The docs for going from v2 to v3 were woefully incomplete unless you were using only basic v2 features. Unnecessarily painful.

2. Speed is relative. For people coming from WordPress or other systems, it’s just fine if you do some basic optimization.

3. If you’re going to use it outside of the Admin Panels in the rest of your app… structure appropriately. It’s not a skill taught in the documentation but is vital. It’s easy to make a mess.

Rails also has rails_admin and some others I forget.
A core developer of Django, I think Carlton Gibson but can't find it, mentioned in a podcast that if one were to commission the development of Django's admin interface from scratch today, it could cost around $1 million USD.
Hmm. I know Django admin is one of the best things about Django... but why $1m? If each developer gets paid $200k/yr, that's 5 developers for 1 year? Sounds crazy to me.
Also a project manager, and one of those is a lead developer/architect. One year is not a lot of time, either.
Yeah, that sounds about right to me.

The admin has a a LOT of features.

More importantly, it's been continuously evolving for nearly 20 years at this point.

Anyone who's actually tried to do a from-scratch rewrite of a system that has 20 years of development behind it will know that 5 engineers for a year is probably optimistic!

Given the flexibility and depth of the django admin, 5 good developers working on it for 1 year sounds about right.

200k/year might sound like a lot but then in a real business there are various overhead costs as well.

I'd say $1m is probably on the lower side of the estimate. Factoring in project delays and misc Murphy law things, wouldn't be surprised if a mediocre team underdelivers with a crappy immitation of the django admin interface after blowing through a couple mil.

There is the frontend and the backend, the whole introspection stack, the admin customization layer, and the integration with permission, filtering, caching, etc.

Add on top of that documentation, testing, and making the whole thing completely independent and pluggable (as django must work without it) but perfectly integrated with it (settings, forms, template overrides, etc).

That's a lot.

You might get feature parity with less, but not with the same guarantees of stability and maturity.

The one data point I can offer is that beat scheduler is a must have for our tiny moonlighting-as-devops squad, and that integrates perfectly with the admin panel.

So, in a word: Celery.

This also allows django tasks to be fired from other clients (other than a direct web site visit), which permits us to author tasks that can be leveraged from other containers/app instances.

Almost all CRUD ops are handled purely in the backend as like "not really django-like" implementations, which suits us perfectly - in case we want to pack up our things and move to a new framework.

The cool thing about django admin is how easy it is to customize within the bounds that it was designed for. You have one liners to add calculated values, complex filters, inline records from related tables, a permission model to limit operations and/or access to certain objects (or records), custom actions on a set or subset of items, import/export, etc etc. 99% of it without touching HTML or CSS. If you need something more complex, you just build it, but right out of the box it provides a lot of options for the content managers. If you stay within the bounds of how it was designed, the extensibility model is solid.
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.

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?

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.

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.

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 ...

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
> 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!

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

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
Maybe the batteries included approach allows the ORM to synergies with the admin in a way that would be harder in other frameworks where the tooling is more ad hoc?
Activeadmin in rails. The reason I believe you need an extremely widespread framework that standardized everything, like rails or django.

Kinda funny how I really disliked activeadmin 10 years ago, now I have an app that's been running for like 12 years using it and it's been doing great. Also, activeadmin improved drastically, kudos to the community

(comment deleted)