While we can have many different admin sites, all admin sites currently
must share the same theme.
Because the admin assumes the template directory 'admin' all the time.
**Proposal**:
A way to direct each AdminSite to the template path where it should find
the templates.
**Example**:
Add a setting called `ADMIN_DEFAULT_THEME = 'admin'`
Add an attribute to AdminSite called `theme` which default to
`ADMIN_DEFAULT_THEME`, and basically this setting controls which
directory this admin site looks for templates.
So whenever a path like 'admin/some_file_name.html' occurs, it is to be
replaced with something like
`f'{admin_theme}/some_file_name.html'`
This will take effect in extends statements, AdminSite templates
loading(index/app index / etc) and ModelAdmin template loading (change
form/list/delete etc..)
If accepted then i'd love to start working on it.
--
Ticket URL: <https://code.djangoproject.com/ticket/32289>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => duplicate
Comment:
You can use
[https://docs.djangoproject.com/en/3.1/ref/contrib/admin/#django.contrib.admin.AdminSite.index_template
AdminSite.index_template]/[https://docs.djangoproject.com/en/3.1/ref/contrib/admin/#django.contrib.admin.AdminSite.app_index_template
app_index_template] and override CSS to use different theme for each admin
site. Also with #32018 changing a theme will be much simpler. I think we
can close it as a duplicate of #32018.
--
Ticket URL: <https://code.djangoproject.com/ticket/32289#comment:1>
* status: closed => new
* resolution: duplicate =>
Comment:
I don't think it qualifies as a duplicate .
By "theme" i mean a complete HTML structure (not just the colors as
#32018 aims) and there is currently no way to have this HTML structure
unique per AdminSite.. and that's what this ticket is about adding.
Replying on Changing the app index and the index template:
This is not the same a new theme.. because clicking on any admin link
inside those "edited pages" would mean either 1.going back to the default
theme for that clicked link or 2. that those ModelAdmin templates were
explicitly set as well.
I hope i made the ticket clearer.
Thanks
--
Ticket URL: <https://code.djangoproject.com/ticket/32289#comment:2>
* status: new => closed
* resolution: => wontfix
Comment:
If you need/want to change all templates, then you shouldn't use
`django.contrib.admin` but rather prepare your own admin interface. I
don't think that we would like to support such an extensive customization.
You can start a discussion on DevelopersMailingList (where you'll reach a
wider audience) if you don't agree.
--
Ticket URL: <https://code.djangoproject.com/ticket/32289#comment:3>