Ive following the steps for adding a template, but when i try and access my URL im getting:
TemplateDoesNotExist at /
My code is below. Also I have my app in the INSTALLED_APPS
in settings. And the template is located within the templates folder within my app.
View
from django.shortcuts import render
from django.http import HttpResponse
def home(request):
return render(request, 'home.html', {})
Setting
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'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',
],
},
},
]
Layout:
Any ideas?
question from:
https://stackoverflow.com/questions/65902681/django-unable-to-locate-template-from-within-app 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…