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'