#25153: The polls tutorial shows INSTALLED_APPS in incorrect order
--------------------------------------+------------------------------------
     Reporter:  pjdelport             |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  1.8
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  1                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by carljm):

 Replying to [comment:3 timgraham]:
 > When overriding admin templates at the project level, you should still
 namespace them such as `polls/templates/admin/polls/app_index.html` in
 which case there shouldn't be any problem with clashing names unless I am
 missing something.

 I'm not sure how this is relevant to the OP's point - there's no reference
 here to "a problem with clashing names" that I can see.

 It is a bit confusing, because there are two very different kinds of
 "overriding" admin templates, both
 [https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#admin-
 overriding-templates conflated in the docs] under the heading "overriding
 admin templates." The first kind is per-app or per-model templates (e.g.
 `admin/polls/app_index.html`), which isn't really an override at all
 (there's no such template in the admin to override), it's just exploiting
 a specialized admin feature where it looks for templates named according
 to a certain per-app or per-model convention. This type of "override" can
 be done either in your project templates or in the app templates,
 regardless of `INSTALLED_APP` ordering, because it's not really an
 override at all.

 But the tutorial also discusses overriding `admin/base_site.html` to edit
 the header of your admin site. This is a real template override, and the
 OP is correct that it won't work in an app template with the current
 `INSTALLED_APPS` ordering (OTOH, this is an override that doesn't really
 make much sense in an app level template anyway).

 I think that the tutorial is internally consistent here (barely, assuming
 you accept that it wouldn't make sense to override admin-wide templates
 like `admin/base_site.html` in an app), but the OP is correct that the
 `INSTALLED_APPS` ordering in the tutorial contradicts our own
 documentation of best practices for `INSTALLED_APPS` ordering, and is the
 opposite of what you'd usually want in order to get the right precedence
 for overrides. So I think this is a change worth making.

--
Ticket URL: <https://code.djangoproject.com/ticket/25153#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.6c86242f198136393e89130818798c4e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to