nuitdelinfo_2021/people/views.py

16 lines
355 B
Python
Raw Normal View History

2021-12-02 21:57:32 +01:00
from django.http import Http404
from django.shortcuts import render
from people.models import People
def index(request, people_id: int):
try:
people = People.objects.get(pk=people_id)
except People.DoesNotExist:
raise Http404("People does not exist")
return render(request, "people.html", {
"people": people
})