Add template using Django templating language
This commit is contained in:
22
projects/templates/projects/all_projects.html
Normal file
22
projects/templates/projects/all_projects.html
Normal 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>
|
||||
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user