在我的终端上说从django.views导入ProductsListView,product_list_view导入错误:无法从django.views导入名称“ ProductsListView”
我几乎尝试了一切
from django.views.generic.list import ListView
from django.shortcuts import render
from .models import Products
class ProductsListView(ListView):
queryset = Product.objects.all()
template_name = "products/list.html"
def product_list_view(request):
queryset = Product.object.all()
context = {
'object_list': queryset
}
return render(request, "products/product_list_.html", context)