Hi again,
Sorry, I probably wasn’t clear in my question. I can paginate pages from the post_list.html view as per the django docs, works great. I want to be able to navigate each of the individual items or posts using next or previous buttons. So when viewing post 2, I can click next to go to the next post or previous to the previous.
My view for the blog post list is:
# blog index
def post_list(request):
post_articles = Post.objects.all()
paginator = Paginator(post_articles, 12)
page = request.GET.get('page')
try:
post_articles = paginator.page(page)
except PageNotAnInteger:
post_articles = paginator.page(1)
except EmptyPage:
post_articles = paginator.page(paginator.num_pages)
return render(request, 'post_list.html', {'post_articles': post_articles})
My view for the individual post:
# blog view single
def post_detail(request, slug):
post = Post.objects.get(slug=slug)
return render(request, 'post/post_detail.html', {
'post': post,
})
I also would love to know how you approach adding in Meta content to the header for each of the pages and posts ie. meta=“description”, meta=“title”. I have looked at some django plugins but they seem overly complicated and don’t work with the latest django version.
Lastly, how do you add in dynamic fields for say a contact or about page, where you can modify the fields via the admin. I have setup flatpages but they are not really full featured enough.
Sorry there so many questions, I will add I have researched a lot, I just can’t seem to find straight forward enough solutions for what I want, which in the end is a Wordpress replacement.
Cheers for your help, really appreciate it!