What is the correct way to put the base.html file in django so that other apps can modify it?
You can place it anywhere you want in your templates directory. I suggest at the root of your templates directory.
project/
app-1/
...
app-n/
templates/
base.html
Your templates directory should be listed under the TEMPLATES setting in the settings.py.
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
'/path/to/project/templates',
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
...
],
},
},
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With