Reverse For ‘Post_Detail’ With Keyword Arguments Not Found

Reverse For ‘Post_Detail’ With Keyword Arguments ‘{‘Slug’: ”}’ Not Found. 1 Pattern(S) Tried: [‘(?P[-A-Za-Z0-9_]+)/$’]?

 # Using reverse()
   reverse('post_detail', kwargs={'slug': 'self.slug'})

   # In a template
{% url 'post_detail' slug='your-slug-value' %}
  

Replace your-slug-value with the actual slug value of the post you’re trying to link to.

Check Your Code
Double-check the parts of your code where you are attempting to reverse the post_detail URL pattern and make sure you are passing the correct arguments.

Finally the most efficient effort after checking your code and everythibg is in other’

  • Log in the admin dash board panel
  • Click on the model causing the error
  • check for every post if slug is thoroughly created and saved , if the slug is not there, add slug manually or delete the post there,


    How to Implement slug in your website or blog


follow the above tutorial to implement slug on your blog

1 thought on “Reverse For ‘Post_Detail’ With Keyword Arguments Not Found”

Leave a Comment