init
This commit is contained in:
15
blog/views.py
Normal file
15
blog/views.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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'
|
||||
Reference in New Issue
Block a user