Opened 4 years ago
Last modified 4 years ago
#32324 closed Cleanup/optimization
Adding more blocks to the contrib.admin site — at Initial Version
Reported by: | Muskan Vaswan | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 3.1 |
Severity: | Normal | Keywords: | admin customize |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | yes |
Description
The Django admin template can be overridden and extended by the user. However, flexibility to customize the admin page can be increased by putting larger chunks of code inside a {% block ... %}... {% endblock %}
. This will be useful as it will allow the user to completely rewrite an entire segment of the page without having to override smaller elements or the entire template.
For example, the user can overwrite the entire navbar if the header was put inside {% block header %}
simply by extending the template.
Refer to this conversation https://groups.google.com/g/django-developers/c/Q8I-0-2Sn4M (point 2) for the full discussion