from django.shortcuts import render, get_object_or_404
from .models import Blog, Comment


def allblogs(request):
    blogs = Blog.objects.all()
    return render(request, 'blog/allblogs.html', {'allblogs': blogs})


def detail(request, blog_id):
    blog = get_object_or_404(Blog, pk=blog_id)
    comments = Comment.objects.filter(blog=blog_id)

    context = {
        'blog': blog,
        'comments': comments,
    }

    return render(request, 'blog/detail.html', context)


def comment(request):
    return render(request, 'blog/detail.html')

3d269a87083bb2e5233a1ee8de4ec20d8b58c38b
<mask token>


def allblogs(request):
    blogs = Blog.objects.all()
    return render(request, 'blog/allblogs.html', {'allblogs': blogs})


<mask token>

<mask token>


def allblogs(request):
    blogs = Blog.objects.all()
    return render(request, 'blog/allblogs.html', {'allblogs': blogs})


<mask token>


def comment(request):
    return render(request, 'blog/detail.html')

<mask token>


def allblogs(request):
    blogs = Blog.objects.all()
    return render(request, 'blog/allblogs.html', {'allblogs': blogs})


def detail(request, blog_id):
    blog = get_object_or_404(Blog, pk=blog_id)
    comments = Comment.objects.filter(blog=blog_id)
    context = {'blog': blog, 'comments': comments}
    return render(request, 'blog/detail.html', context)


def comment(request):
    return render(request, 'blog/detail.html')

from django.shortcuts import render, get_object_or_404
from .models import Blog, Comment


def allblogs(request):
    blogs = Blog.objects.all()
    return render(request, 'blog/allblogs.html', {'allblogs': blogs})


def detail(request, blog_id):
    blog = get_object_or_404(Blog, pk=blog_id)
    comments = Comment.objects.filter(blog=blog_id)
    context = {'blog': blog, 'comments': comments}
    return render(request, 'blog/detail.html', context)


def comment(request):
    return render(request, 'blog/detail.html')

from django.shortcuts import render, get_object_or_404
from .models import Blog, Comment


def allblogs(request):
    blogs = Blog.objects.all()
    return render(request, 'blog/allblogs.html', {'allblogs': blogs})


def detail(request, blog_id):
    blog = get_object_or_404(Blog, pk=blog_id)
    comments = Comment.objects.filter(blog=blog_id)

    context = {
        'blog': blog,
        'comments': comments,
    }

    return render(request, 'blog/detail.html', context)


def comment(request):
    return render(request, 'blog/detail.html')
