SHARE
TWEET

Untitled

a guest Jul 21st, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top