[Django] #35283: Dynamic admin site titles

6 views
Skip to first unread message

Django

unread,
Mar 8, 2024, 12:36:36 AM3/8/24
to django-...@googlegroups.com
#35283: Dynamic admin site titles
-----------------------------------------+------------------------------
Reporter: Kasun Herath | Owner: Kasun Herath
Type: New feature | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-----------------------------------------+------------------------------
AdminSite
[https://github.com/django/django/blob/main/django/contrib/admin/sites.py#L29]
has attributes defined that can be used to customize admin site_header,
site_title and index_title.

But these cannot be populated dynamically. I propose to add three method
like below, that would enable populating site_header, site_title and
index_title dynamically.

{{{
def get_site_header(request, *args, **kwargs):
# return computed site_header
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35283>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 8, 2024, 1:44:20 AM3/8/24
to django-...@googlegroups.com
#35283: Dynamic admin site titles
-------------------------------+----------------------------------------
Reporter: Kasun Herath | Owner: Kasun Herath
Type: New feature | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------------------------
Changes (by Mariusz Felisiak):

* easy: 1 => 0
* resolution: => wontfix
* status: assigned => closed

Comment:

Thanks for the ticket, however, Django Admin is not a
[https://docs.djangoproject.com/en/stable/ref/contrib/admin/#module-
django.contriab.admin universal tool for building an app] and adding a new
option/method to the `AdminSite` is always controversial (we already have
many of them). I think it's a bit of a niche case. Also, you should be
able to achieve the same by overriding `AdminSite.each_context()`.

Please first start a discussion on the DevelopersMailingList, where you'll
reach a wider audience and see what other think, and
[https://docs.djangoproject.com/en/stable/internals/contributing/triaging-
tickets/#closing-tickets follow the triaging guidelines with regards to
wontfix tickets].
--
Ticket URL: <https://code.djangoproject.com/ticket/35283#comment:1>
Reply all
Reply to author
Forward
0 new messages