#14140 closed (duplicate)
There is no way to override admin templates to the project level
Reported by: | jacmkno | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Keywords: | extends admin templates | |
Cc: | rico.bl@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The template system allows to override admin templates for applications and models but for the project level it throws 'maximum recursion depth exceeded' because the template system keeps looking for the extended template in the current template path. For example this code generates the problem when placed in "project/templates/admin/base.html":
{% extends "/admin/base.html" %} ....
I have been unable to think of a solution for this problem yet, but I think this is an important missing feature. I think patches from Ticket #2414 may be used to solve this problem.
Change History (6)
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 14 years ago
Triage Stage: | Design decision needed → Unreviewed |
---|
comment:3 by , 14 years ago
I think every admin template should extend a "base" template.
This way it would be possible to override templates on the project level (and maybe through external apps also).
As an example, my solution for customizing the admin index:
- Move the original admin/index.html template to django/contrib/admin/templates/admin/base
- Create the admin/index.html template that extends admin/base/index.html
{# admin/index.html #} {% extends "admin/base/index.html" %} {# ... customizations here ... #}
- On the project level, admin/index.html would extend admin/base/index.html and override the one bundled with the admin app
I can take this ticket if this solution is reasonable.
comment:4 by , 14 years ago
Cc: | added |
---|
comment:5 by , 14 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
I think this is basically the same underlying issue as #8158. Please re-open if that's not the case. Note also the workaround on that ticket.
'untriaging' until another pair of eyes can look at this.