Context Navigation

What we propose here is a revamp of the the admin app looking for minimal work to customize the admin, striving for reusability and maintenability while still making it possible to:

extend every pages of the admin in an arbitrary fashion without having to rely on Javascript hacks

make it possible to add views easily

Refresh the design and make it responsive

Current admin limitations

Current methods to customize the pages of the admin are the following:

most common way: Override ModelAdmin or Admin class methods, inject needed variables in template context and then override the templates: this can be made simpler, overriding templates is not considered future proof and can be made simpler

There are hooks to insert custom code (filter spec, admin actions) but it's predefined, not flexible and bound to features already defined in the admin. What if one wants a custom sidebar that fills the form dynamically from generated list of templates ?

Insert Javascript, this is the most flexible way to extend the admin, it's hacky and promotes creation of code that might not be accessible.

Overrindg templates: this is tricky since and has the same limitations as above lake of maintenability, readability and reusability and can make an extensive (anti-pattern) use of templatetags to get things done.

Monkeypatching: I have no example of that but I know it's used in production on some sites

In a context where you have several admin sites or experiences because of different user permissions or settings, templates are the only reusable part. You can create functions to encapsulate some functionality but there is no canvas for that and can become a bit messy with a big file named like admin_views_utils.py.

Pros

No more hacks: Offers a clear canvas to extend the admin

...

Cons

Backward incompatible

...

Comments

Instead of proposing a specific solution, let's focus on identifying the issues that the current admin has without the editorial content. For example "no more monkey patching" as a pro without an actual example of functionality that can not be done without monkey patching the admin is baseless. –Travis Swicegood

I reworked the page to try to make it more obvious that it's not Hydro the next admin and main topic but that the Hydro application is just an idea with code. –Amirouche