Структура:
settings.py:
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',
],
},
},
]
urls.py
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('admin/', admin.site.urls),
path('home/', include('home.urls')),
]
urls.py
from django.urls import path
from home import views
urlpatterns = [
path('', views.index, name='index'),
]
views.py
from django.shortcuts import render
def index(request):
return render(request, 'home/index.html')
Ошибка - не может найти template: