How to specify a path to base_site.html that would have views the blog saw it.
CodePudding user response:
You have to do 2 things
- Edit the templates settings to include templates folder
- Call the template by ‘admin/base_site.html’
CodePudding user response:
First of all add this in your settings.py 'DIRS': [os.path.join(BASE_DIR / "templates")] For Example:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR / "templates")],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
Now change the path or just paste this, and let me know..
return render(request, "admin/base_site.html", {"tasks":tasks})