Changes between Version 1 and Version 2 of ExtendingAdminTemplates
- Timestamp:
- Apr 6, 2006, 3:22:28 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ExtendingAdminTemplates
v1 v2 8 8 1. make a directory in your template path named ``admin_copies`` 9 9 2. copy change_form.html from your Django install's contrib/admin/templates/admin 10 3. create your admin/project_name/model_name/change_form.html: 11 the template loader will look first in your template_dirs before looking in the app directories, i.e. django.contrib.admin. 10 3. create the template to override admin, in this case admin/auction/participant/change_form.html (the template loader find it because it looks first in your template_dirs before looking in the app directories, i.e. django.contrib.admin.) 12 11 4. your change_form.html will look something like: 13 14 12 {{{ 15 13 {% extends "admin_copies/change_form" %} … … 30 28 This makes the layout use a sidebar and populates it with some links for related functions or data. 31 29 32 You need the admin_copies directory because you can not extend admin/change_form because it will never be found--you are editing the very file that overrides it. So you give the template loader another place to look. Hence, the copy.30 You need the admin_copies directory because you can not extend admin/change_form since it will never be found--you are editing the very file that overrides it. So you give the template loader another place to look. Hence, the copy. 33 31 34 All very neat and clean. 35 36 32 All very neat and clean.