feat: article page

This commit is contained in:
root
2025-10-06 21:32:59 +03:00
parent e09da0d5a9
commit b11161bce3
5 changed files with 67 additions and 8 deletions

View File

@@ -1,5 +1,13 @@
from .models import Article
from django.shortcuts import render
from django.http import Http404
def archive(request):
return render(request, 'archive.html', {"posts": Article.objects.all()})
def get_article(request, article_id):
try:
post = Article.objects.get(id=article_id)
return render(request, 'article.html', {"post": post})
except Article.DoesNotExist:
raise Http404