List view

Report a typo

We're working on a Django app for a library. We want to display existing books on our page, so create a view that lists them. Use the generic view to list the data from the Book model. Also, set the context object as books, and the template as books_preview.html.

Write a program in Python 3
from django.views.generic import ...

class BookListView(...):
model = ...
context_object_name = ...
queryset = ...
template_name = ...

Create a free account to access the full topic