Creating a html template for the view
This commit is contained in:
parent
5fd8621793
commit
a74b03e094
@ -9,7 +9,7 @@ https://docs.djangoproject.com/en/4.0/topics/settings/
|
||||
For the full list of settings and their values, see
|
||||
https://docs.djangoproject.com/en/4.0/ref/settings/
|
||||
"""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
@ -56,7 +56,7 @@ ROOT_URLCONF = "portfolio.urls"
|
||||
TEMPLATES = [
|
||||
{
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
"DIRS": [],
|
||||
"DIRS": [os.path.join(BASE_DIR, "projects/templates")],
|
||||
"APP_DIRS": True,
|
||||
"OPTIONS": {
|
||||
"context_processors": [
|
||||
|
@ -1,7 +1,5 @@
|
||||
from django.shortcuts import render
|
||||
from django.http import HttpResponse
|
||||
|
||||
# Create your views here.
|
||||
def project_list(request):
|
||||
msg = "<h1>Hello, World!</h1>"
|
||||
return HttpResponse(msg)
|
||||
return render(request, "projects/index.html")
|
||||
|
Loading…
Reference in New Issue
Block a user