from django.shortcuts import render, get_object_or_404

# Create your views here.
from blog.models import BlogArticles


def blog_title(request):
    blogs = BlogArticles.objects.all()
    return render(request, "blog/title.html", {"blogs": blogs})


def blog_article(request, article_id):
    # article = BlogArticles.objects.get(id=article_id)
    article = get_object_or_404(BlogArticles, id=article_id)
    return render(request, "blog/content.html", {"article": article})

from django.shortcuts import render, get_object_or_404

# Create your views here.
from blog.models import BlogArticles


def blog_title(request):
    blogs = BlogArticles.objects.all()
    return render(request, "blog/title.html", {"blogs": blogs})


def blog_article(request, article_id):
    # article = BlogArticles.objects.get(id=article_id)
    article = get_object_or_404(BlogArticles, id=article_id)
    return render(request, "blog/content.html", {"article": article})

# Create your views here. # article = BlogArticles.objects.get(id=article_id)