In the spirit of ''"There should be one – and preferably only one –
obvious way to do it."'' I think that overriding the default admin site is
the obvious way to customize django admin site from now on and therefore,
it should be mentioned in the tutorial.
**Currently, the documentation states (this paragraph has not been changed
at least from Django 1.9):**
* We use this approach to teach you how to override templates. In an
actual project, you would probably use the
[https://docs.djangoproject.com/en/2.1/ref/contrib/admin/#django.contrib.admin.AdminSite.site_header
django.contrib.admin.AdminSite.site_header] attribute to more easily make
this particular customization.
**I propose to change this paragraph thus:**
* We use this approach to teach you how to override templates. In an
actual project, you would probably
[https://docs.djangoproject.com/en/2.1/ref/contrib/admin/#overriding-
default-admin-site override the default admin site] and use
[https://docs.djangoproject.com/en/2.1/ref/contrib/admin/#django.contrib.admin.AdminSite.site_header
django.contrib.admin.AdminSite.site_header] attribute to more easily make
this particular customization.
--
Ticket URL: <https://code.djangoproject.com/ticket/29999>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
I don't see overriding the admin site as a necessary requirement.
`site.site_header = '...'` still works fine.
--
Ticket URL: <https://code.djangoproject.com/ticket/29999#comment:1>
Comment (by Jan Musílek):
Replying to [comment:1 Tim Graham]:
> I don't see overriding the admin site as a necessary requirement.
`site.site_header = '...'` still works fine.
Sure, it isn't necessary, I just see it as a new obvious way how to
customize admin site in broader context. Is it the recommended way? I
thought it might, which is why I proposed this change in the first place.
Would it be better if we changed **and** to **or**?
* We use this approach to teach you how to override templates. In an
actual project, you would probably
[https://docs.djangoproject.com/en/2.1/ref/contrib/admin/#overriding-
default-admin-site override the default admin site] **or** use
[https://docs.djangoproject.com/en/2.1/ref/contrib/admin/#django.contrib.admin.AdminSite.site_header
django.contrib.admin.AdminSite.site_header] attribute to more easily make
this particular customization.
--
Ticket URL: <https://code.djangoproject.com/ticket/29999#comment:2>
Comment (by Rodrigo):
I agree with Tim, overriding the admin site seems out of the scope of an
introductory tutorial to me. If mentioned, I think it should be with
something like "In an actual project, if you need to heavily customize the
admin, it can be entirely overriden with...", not as a way of changing the
site header - which is what the site.site_header attr is for
--
Ticket URL: <https://code.djangoproject.com/ticket/29999#comment:3>
* status: new => closed
* resolution: => wontfix
--
Ticket URL: <https://code.djangoproject.com/ticket/29999#comment:4>