1π
Your templates folder should be within your app folder home (under about), otherwise Django wonβt find it. Check out https://django-project-skeleton.readthedocs.io/en/latest/structure.html for the proper file structure. My guess is the same could be said for the other folders withing your templates folder. You can have a templates folder in your root, but I donβt think this is what you will need in your case.
To create a global template, you can have a template folder in your root βtestWebsiteβ directory like you already have. Then in your settings.py do the following:
# settings.py
TEMPLATES = [
{
...
'DIRS': [str(BASE_DIR.joinpath('templates'))],
...
},
]
What I usually do is create a base.html in each app, then in each of your html pages within the app you can add a line like {% extends "home/base.html" %}
. And in each of your base.html files add {% extends "base.html" %}
Something like this (I didnβt include all the files, just a sample):
testWebsite
βββ about
β βββ templates
β βββ about
β βββ base.html
β βββ about.html
βββ home
β βββ templates
β βββ home
β βββ base.html
β βββ greet.html
β βββ index.html
βββ project_long_page
β βββ templates
β βββ project_long_page
β βββ base.html
β βββ project_long_page.html
βββ templates
β βββ base.html
βββ testWebsite
βββ settings.py