from django.shortcuts import render,redirect,reverse from django.http import HttpResponse, HttpResponseNotFound, Http404,HttpResponseRedirect #zeitgeraffel from django.utils import timezone from django.core.exceptions import ObjectDoesNotExist import datetime import pytz from hpst.models import Termin # Create your views here. def index(request): termine=Termin.objects.filter(date__gt=timezone.now()).order_by( 'date') context ={ "termine":termine, "data":"Gfg is the best", "list":[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] } # return response with template and context return render(request, "index.html", context) def termin(request,tid): #print (tid) error="" try: termin=Termin.objects.get(id=tid) except ObjectDoesNotExist: error="Dieser Termin existiert nicht" context ={ "termin":termin, "error":error, } # return response with template and context return render(request, "termin.html", context) def impressum(request): cookies=request.COOKIES #print(cookies) error="Kein Impressum" context ={ "cookies":cookies, } # return response with template and context return render(request, "impressum.html", context)