I am trying to change the admin HTML templates but I don't really now how to find the already created Django templates in the first place. Is there an easy way to find all the templates?
Right now I am making new html templates and extending them to Djangos templates.
CodePudding user response:
If you just look for an easy way to change the admin template you can use the django-admin-interface. You can change colors and it looks a bit more attractive. This works in my case pretty good.
pip install django-admin-interface
CodePudding user response:
Is there an easy way to find all the templates?
Yes, they're all in the django/contrib/admin/templates/admin
. You should be able to find the top-level django
directory in the site-packages
directory where you installed your Python packages. For example, if you created a .venv
directory, it could be in .venv/lib/python3.8/site-packages/
.
Otherwise, you could find the templates in the Github repository here.
The Django guide recommends copying those templates over to your own templates
directory.