Перешел на структуру шаблонов
All checks were successful
Auto-Deploy-Shop / deploy (push) Successful in 7s
All checks were successful
Auto-Deploy-Shop / deploy (push) Successful in 7s
This commit is contained in:
@@ -55,7 +55,9 @@ ROOT_URLCONF = 'core.urls'
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
'DIRS': [
|
||||
os.path.join(BASE_DIR, 'templates'),
|
||||
],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
|
||||
@@ -18,9 +18,12 @@ from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
from django.conf.urls.static import static # <--- Добавьте эту строку
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('home/', views.home, name='home'),
|
||||
path('about/', views.about, name='about'),
|
||||
path('', include('products.urls')), # Главная страница теперь ведет в products
|
||||
]
|
||||
|
||||
|
||||
8
core/views.py
Normal file
8
core/views.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# core/views.py
|
||||
from django.shortcuts import render
|
||||
|
||||
def home(request):
|
||||
return render(request, 'home.html')
|
||||
|
||||
def about(request):
|
||||
return render(request, 'about.html')
|
||||
Reference in New Issue
Block a user