from django.shortcuts import render, get_object_or_404 
from .models import Post
# Create your views here.

def home(request):

	posts = Post.objects.order_by('pub_date')

	return render(request,'posts/home.html', {'posts':posts})

def posts_details(request, post_id):
	post = get_object_or_404(Post, pk=post_id)
	return render(request,'posts/posts_detail.html',{'post':post})

ad9c16a661e2323013a1934ecb090393e06467e6
<mask token>

<mask token>


def posts_details(request, post_id):
    post = get_object_or_404(Post, pk=post_id)
    return render(request, 'posts/posts_detail.html', {'post': post})

<mask token>


def home(request):
    posts = Post.objects.order_by('pub_date')
    return render(request, 'posts/home.html', {'posts': posts})


def posts_details(request, post_id):
    post = get_object_or_404(Post, pk=post_id)
    return render(request, 'posts/posts_detail.html', {'post': post})

from django.shortcuts import render, get_object_or_404
from .models import Post


def home(request):
    posts = Post.objects.order_by('pub_date')
    return render(request, 'posts/home.html', {'posts': posts})


def posts_details(request, post_id):
    post = get_object_or_404(Post, pk=post_id)
    return render(request, 'posts/posts_detail.html', {'post': post})

from django.shortcuts import render, get_object_or_404 
from .models import Post
# Create your views here.

def home(request):

	posts = Post.objects.order_by('pub_date')

	return render(request,'posts/home.html', {'posts':posts})

def posts_details(request, post_id):
	post = get_object_or_404(Post, pk=post_id)
	return render(request,'posts/posts_detail.html',{'post':post})
