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