Add template using Django templating language

This commit is contained in:
2022-01-04 16:03:43 +01:00
parent edaa41811f
commit 4f8cf91609
2 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<!-- CSS only -->
<!-- link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous" -->
</head>
<body>
<h1>Hi again</h1>
<!--div class="alert alert-warning" role="alert">
Remember that errors are your friends!
</div -->
{{ projects }}
{% for project in projects%}
<h1>{{ project.title }}</h1>
<p>{{ project.description }}</p>
<p>{{ project.technology }}</p>
{% endfor %}
</body>
</html>

View File

@@ -9,4 +9,4 @@ def project_list(request):
def all_projects(request):
# query the db to return all project objects
projects = Project.objects.all()
return render(request, "all_projects.html", {"projects": projects})
return render(request, "projects/all_projects.html", {"projects": projects})