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