Files
blog24/blog/views.py
2024-07-20 11:36:35 +02:00

16 lines
366 B
Python

from django.views.generic import ListView, DetailView
from blog.models import Article
class ArticleListView(ListView):
model = Article
template_name = 'blog/article_list.html'
context_object_name = 'articles'
class ArticleDetailView(DetailView):
model = Article
template_name = 'blog/article_detail.html'
context_object_name = 'article'