1 from django.shortcuts import get_object_or_404, render
2 from django.http import HttpResponse
3 from .models import Animal
5 # Create your views here.
7 return HttpResponse("Hello, world. You're at the animals index.")
10 def detail(request, animal_id):
11 # return HttpResponse("Hello, world. You're at the animal {}.".format(animal_id))
12 animal = get_object_or_404(Animal, pk=animal_id)
13 return render(request, 'animals/detail.html', {'animal': animal})