I\'ve been trying to get custom templates for the admin page for Django working but have been unsuccessful. I\'ve read the django documentation and several blogs which explain i
I couldn't get the admin template to be recognized when doing this step in part two of the Django tutorial.
This is how I solved it:
Using the information in this answer, I printed the value of TEMPLATE_DIRS
:
settings.py
file exists (for me this is R:\jeffy\programming\sandbox\python\django\tutorial\mysite\mysite\
)python
>>> import settings
>>> settings.TEMPLATE_DIRS
, which outputs ['R:\\jeffy\\programming\\sandbox\\python\\django\\tutorial\\mysite\\templates']
So this is the expected location of the templates directory for this project. The admin directory goes into that, and the base_site.html
file goes into that.
The other problem I had was that it was working, but I only changed the
field, so I just didn't notice it. (I thought I was changing the main header.)