adding
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
from django.shortcuts import get_object_or_404, render
|
||||
|
||||
from .models import Article
|
||||
|
||||
|
||||
def article_list(request):
|
||||
articles = Article.objects.filter(is_published=True)
|
||||
return render(request, "landing/article_list.html", {"articles": articles})
|
||||
|
||||
|
||||
def article_detail(request, slug):
|
||||
article = get_object_or_404(Article, slug=slug, is_published=True)
|
||||
return render(request, "landing/article_detail.html", {"article": article})
|
||||
Reference in New Issue
Block a user