from django.shortcuts import render from .models import Book def index(request): books = Book.objects.all() context = { 'books': books, 'project_name': 'Library', } return render(request, 'core/index.html', context)