I am following part 2 of the Django tutorial. I am trying to override an admin template (base_site.html)
I copied the file from the django/contrib/admin/templates to mytemplates/admin/base_site.html
I also updated settings.py:
#Base Directory
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
#Template directories
TEMPLATE_DIRS = (os.path.join(BASE_DIR, 'mytemplates'),)
I tried putting the mytemplates folder in the root of the project folder as well as in the mysite folder with no luck. Any pointers would be great!
EDITED PREVIOUS USER RESPONSE — THIS WORKS:
I think your relative path to the templates directory is wrong.
If you follow these steps it should work: (I tested it myself)
Put the
mytemplatesdir side by side with themanage.pyfileChange the TEMPLATE_DIRS to:
Make sure the order of the template loader is: