From c22cef439b9c0cd76f513d129595a8493924fd88 Mon Sep 17 00:00:00 2001 From: Cutty Date: Sat, 14 Mar 2026 16:54:39 -0600 Subject: [PATCH] Tutorial 6 Build Template --- touragency/agency/templates/tours/index.html | 16 ++++++++++++++++ touragency/agency/views.py | 12 ++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 touragency/agency/templates/tours/index.html diff --git a/touragency/agency/templates/tours/index.html b/touragency/agency/templates/tours/index.html new file mode 100644 index 0000000..16a4b9b --- /dev/null +++ b/touragency/agency/templates/tours/index.html @@ -0,0 +1,16 @@ + + + + + + Asia Tours + + +

Asia Tours Schedule for June

+ + + diff --git a/touragency/agency/views.py b/touragency/agency/views.py index af798f7..7eb722f 100644 --- a/touragency/agency/views.py +++ b/touragency/agency/views.py @@ -1,7 +1,15 @@ -from django.http import HttpResponse from django.shortcuts import render +from .models import Tour + +# from django.http import HttpResponse + # Create your views here. def index(request): - return HttpResponse("Asian Tours Agency") + tours = Tour.objects.all() + context = {"tours": tours} + return render(request, "tours/index.html", context) + + +# return HttpResponse("Asian Tours Agency")