[Answered ]-Django: NoReverseMatch at /home/blog/ Reverse for 'post-detail' not found. 'post-detail' is not a valid view function or pattern name

1👍

In your models.py change the get_absolute_url as follow. You need to include the app name also before calling any specific url from an app.

def get_absolute_url(self):
        return reverse('blog:post-detail', kwargs={'id': self.id})

Leave a comment