From 84f2eae72d95355a3fa0619ee01e7286ca1a1d0b Mon Sep 17 00:00:00 2001 From: mxjdi Date: Thu, 24 Apr 2025 23:16:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=86=85=E6=A8=A1=E6=9D=BF=E7=9B=AE=E5=BD=95=EF=BC=8C=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E6=A8=A1=E6=9D=BF=E7=9A=84=E9=A1=BA=E5=BA=8F=E6=98=AF?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Django5/settings.py | 2 +- helloWorld/templates/index2.html | 10 ++++++++++ helloWorld/views.py | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 helloWorld/templates/index2.html diff --git a/Django5/settings.py b/Django5/settings.py index b5bb881..83918f8 100644 --- a/Django5/settings.py +++ b/Django5/settings.py @@ -53,7 +53,7 @@ ROOT_URLCONF = 'Django5.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [BASE_DIR / 'templates'] + 'DIRS': [BASE_DIR / 'templates',BASE_DIR / '/helloWorld/templates'] , 'APP_DIRS': True, 'OPTIONS': { diff --git a/helloWorld/templates/index2.html b/helloWorld/templates/index2.html new file mode 100644 index 0000000..540e743 --- /dev/null +++ b/helloWorld/templates/index2.html @@ -0,0 +1,10 @@ + + + + + Title + + +应用内模板 + + \ No newline at end of file diff --git a/helloWorld/views.py b/helloWorld/views.py index 2071caa..3ad7b04 100644 --- a/helloWorld/views.py +++ b/helloWorld/views.py @@ -3,4 +3,4 @@ from django.shortcuts import render # Create your views here. def index(request): - return render(request, 'index.html') + return render(request, 'index2.html')