Django.template.exceptions.TemplateDoesNotExist: templates/index.html Ошибка
Я делаю программу аутентификации на Django, но она продолжает выдавать мне эту ошибку. django.template.exceptions.TemplateDoesNotExist: templates/index.html Error.
PLS help me coz I have spent hours trying to solve this problem.
Views.py
from django.http import HttpResponse
def home(request):
return render(request, "authentication/index.html")
def signin(request):
return render(request, "authentication/signin.html")
def signout(request):
pass
Urls.py
from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('',views.home, name = "home"),
path('signin',views.signin, name = "signin"),
path('signout',views.signout, name = "signout"),
]
Настройки
authentication - это моя папка app, а gfg - мой начальный проект.
Из того, что я вижу в вашем коде. вы должны создать папку "templates" в корне каталога вашего проекта. вы также должны создать папку "authentication" в папке templates и поместить index.html в папку authentication. это будет работать.