Today, we are going to cover a simple way to customise any template that lives in a third-party package, this includes django itself - most notably the admin & auth modules.
- Locate the which template contains the html you need to override and copy the contents and make a note of the path relative the parent
templatesdirectory. For example to the admin index template is located at
django/contrib/admin/templates/admin/index.htmlso we need
- Recreate this file in your project with the exact same path under a templates directory.
- Paste in the exist contents of the template.
- Make your changes and see them reflected on the relevant page(s) in your browser
Done! Tomorrow another quick tip!