A Django Admin Wishlist
ankursethi.in
ankursethi.in
(I do agree though that thumbnail display might be critical for admin, depending on project specifics.)
[1] Seems. I've never implemented anything complex around it yet.
Permissions could be useful for quick customization, though—you can hide the apps admin staff certainly won't need to access, and simplify the UI that way.
This makes it difficult for browsing, because you can't link to and explore relationships in you data (think of how IMBD works) nor can you tweak the edit page very meaningfully.
There is actually a more or less abandoned contrib app called databrowse, but I don't think it was ever much good. Unfortunately I haven't seen anything to indicate true data browsing is on the horizon for admin.
Meanwhile, if there's some ‘legitimate’ use case involving browsing your data—well, Django makes building a dedicated UI for that quick and easy enough. Take class-based list/detail views[0], throw in a couple of templates, and you're done—and the result is easier to customize than the admin site.
This, of course, depends on a project—the amount of maintenance involved, possibility of change in requirements, and other factors.
[0] By the way, class-based view documentation got a neat update recently, now easier to read and navigate: https://docs.djangoproject.com/en/dev/ref/class-based-views/
If you write your own custom admin for some models or apps then you've either got to write it for all apps or users will have two inconsistant admin interfaces to deal with with a different UI and feature set between them.
So you decide write a custom CRUD for all apps including all those pesky 3rd party ones. To avoid all that boilerplate you write a few bits of code to introspect models and declaratively customize the interface.
Guess what. You've just reinvented contrib.admin with less features and more bugs.
Learning to customize the admin isn't hard and takes surprisingly little code.
In return you get a single consistant UI for all your code.
#1. The default ModelAdmin can not, This is totally true. You could overwrite every applicable method until it does for a specific set of models, though I'd gather that this is more trouble than it's worth.
#2. You can restrict permissions to staff members that are not superusers. You do this via the permissions system, either the built-in one or the custom one. It's true that in the default admin.site, staff members can access the index page, but the index page may be empty for them.
#3. With the proper permissions, modules or models are hidden from that user. django-admin-tools gets you the rest of the way to that goal.
#4. There are workarounds as you note, they almost all would require some concession on more third-party libraries in the core, or the possibility of linking a 15MB image to a page.
#5. Solution Noted :)
#6. You could probably subclass ModelAdmin to fix this one. I'd like to see it done, though personally I don't see it as a big deal.
#7. I don't like GFKs, I don't have any strong opinion on their widgets or what could be better, You could make a very detailed widget presumably though
#8. This isn't entirely true, you can use inlines. You could probably hack the normal widgets too to give you an edit button with ?popup=True (not positive about that)
* customizing the templates is a real pain often requiring a lot of copy-pasta to change just a small thing, particularly the index -- more granular control would be nice (through the use of includes and snippets perhaps): https://github.com/django/django/blob/master/django/contrib/...
* support for custom "admin panels" or the like to display on a dashboard, user-defined widgets that perform actions that go beyond a CRUD style form -- I authored the flask-peewee project that comes with an admin and have used panels for things like provisioning API keys, showing login/signup stats, etc.
* built-in support for exporting records in various formats (also exists in flask-peewee)
* more powerful filtering interface, e.g. http://i.imgur.com/FTMEe.jpg
* built-in support for typeahead on foreign keys, e.g. http://i.imgur.com/TQwAX.png
I opened a ticket and would be glad also to fix it (as Rob Pike says something like don't just say about bug, fix it!). But I'd like to have someone from django developers to give me some feedback if it makes sense at all etc.
I agree with the author how much django admin could be better as developers we can fix it, aren't we? ;)
So we built an Admin like thing called Smartmin based on class based views: http://github.com/nyaruka/smartmin
It is very similar to the Admin package but a bit more useful I think. If you find yourself hating some of the still existing boilerplate in Django, this might be your ticket.
Fairly up to date docs here: http://smartmin.readthedocs.org/en/latest/index.html
- Separate it from Django and put it on Github, so that it is not subject to the framework's release cycle.
Most of the requests here would be done by the end of the year.
You need to alter the style of everything, add new fields, remove fields, use all kind of ugly hacks for simple tweaks.. and at the end, you realise that it would have been so much faster and easier to get that page done from scratch, like you'd do for all the normal pages of the website.