#35283 closed New feature (wontfix)

Dynamic admin site titles

Reported by: Kasun Herath Owned by: Kasun Herath
Component: contrib.admin Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Change History (1)

comment:1 by Mariusz Felisiak, 10 months ago

Easy pickings: unset
Resolution: wontfix
Status: assignedclosed

Thanks for the ticket, however, Django Admin is not a 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 follow the triaging guidelines with regards to wontfix tickets.

Note: See TracTickets for help on using tickets.
Back to Top