2 ms·
My experience report is based on operating a production API with about 30 DB models, not incredibly complex, but with somewhat non-standard requirements like mu
by theptip 9y ago
My experience report is based on operating a production API with about 30 DB models, not incredibly complex, but with somewhat non-standard requirements like multi-tenancy. This opinion is shared by the developers on my team as well, if that's worth anything in addition.
I've found the easy stuff to be very easy to do in the Django admin, and every time I've tried to do something off the beaten track, it's taken me days instead of the hours or minutes it feels like it should do.
Any of these would be good examples of things that feel like they should be easy, but aren't:
* Adding a link to a custom page onto the frontpage of the admin, ideally under a custom "App" header.
* Creating a read-only view onto related objects (impossible in some situations, depending on the direction of the FKey relationship, annoying in others).
* Presenting a form for creating nested one-to-one objects along with a parent.
I'm sure that if you routinely make modifications to the Django Admin it gets easier; the second time on any of these items is 10-100 times quicker for me.
I'd blame the poor code discoverability of the template-based system, poor documentation, and lack of a broad corpus of examples for making this harder than it could be.
- elnygren 9y agoIf you are spending "days" in some Django Admin modifications, you are definitely doing it wrong. At that point you should have rolled out your own admin just like any other feature. Clearly the builtin admin is working against you rather than with you if it takes that long to do what you need to get done. The Django admin is meant for development. Ofc, it can be used by non-devs and I've seen a multimillion dollar business that mainly uses the builtin admin to manage their main product. However, there's always that point when customising something that is fundamentally different than what your needs are doesn't make sense.
- theli0nheart 9y ago> * Adding a link to a custom page onto the frontpage of the admin, ideally under a custom "App" header. This one's simple—just override base_site.html. As for the others, I'm not really sure I understand what creating a read-only view / form for nested 1-1 objects means, but I'm sure there's a decent, not so crazy solution out there.
- Alex3917 9y ago> just override base_site.html And if your changes break in a future version of Django, how exactly is anyone going to be able to debug that? Having to override admin templates that are at best only semi-documented is incredibly hacky.
- theli0nheart 9y agoWith any Django app, you’re going to pin your requirements to a specific Django version as a matter of course. If the change is broken in a future Django version, you’d need to update it like you would need with any other breaking change. But, if experience is any guide, despite lots of tinkering with the admin, Django has yet to break anything I’ve customized in the admin (I’ve been using Django since 0.96). YMMV.
- Daishiman 9y agoDjango has the best deprecation policy of any framework I've seen. Breaking changes are always documented and given fair advance for changes. In many years of working with Django I have not really seen a significant breaking change in the admin unless you override private methods.