Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. TemplateDoesNotExist at /products/
  2. products/product_list.html
  3.  
  4. #from django.views import ListView
  5. from django.views.generic import ListView
  6. from django.shortcuts import render
  7.  
  8. # Create your views here.
  9.  
  10. from .models import Product
  11.  
  12. class ProductListView(ListView):
  13. queryset = Product.objects.all()
  14. tempalate_name = "products/list.html"
  15.  
  16. def get_context_data(self, *args, **kwargs):
  17. context = super(ProductListView, self).get_context_data(*args, **kwargs)
  18. print(context)
  19. return
  20.  
  21.  
  22. def product_list_view(request):
  23. queryset = Product.objects.all()
  24. context = {
  25. 'qs': queryset
  26. }
  27. return render(request, "products/list.html", context)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement