79198540

Date: 2024-11-18 02:25:21
Score: 0.5
Natty:
Report link

In views.py , add this code, passes the queryset as 'blogpost_list' to the template

from django.views.generic import ListView

from .models import BlogPost

class BlogListView(ListView):

model = BlogPost
template_name = 'blog/blog_list.html'
context_object_name = 'blogpost_list' 
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Amina K M