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')