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.
Intro to views in Django
List view
Report a typo
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
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.