Class-based views (CBVs) hiện thực view dưới dạng class Python thay vì hàm, cho phép tái sử dụng qua kế thừa và mixin. Generic views là các CBV tích hợp sẵn xử lý các pattern phổ biến (liệt kê, chi tiết, tạo/cập nhật/xóa) với mã tối thiểu — giảm đáng kể boilerplate cho CRUD chuẩn.
Function-based so với class-based
():
articles = Article.objects.()
render(request, , {: articles})
django.views.generic ListView
():
model = Article
template_name =
context_object_name =
