79111181

Date: 2024-10-21 17:48:57
Score: 0.5
Natty:
Report link

You are getting the error because post is a reserved keyword in python

So, here is the updated code:

def post_page(request, slug):
    post_hello = post.objects.get(slug=slug)
    return render(request, 'app1/post_page.html', {"post_hello": post_hello})

you can change the name post_hello as per your choice

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Google User