The current path, dashboard/posts/1/, didn’t match any of these.

I am trying to use the slug path to display the content in the post_detail.htm file by using this http://localhost:8000/dashboard/posts/2323. As I press enter to write something after dashboard/ something else, the content in post_detail does not display

   # Dashboards

```path('dashboard/', include('dashboards.urls')),
,,,


dashboards app urls.py 

```# posts path

path('posts<slug:post_slug>/', views.post_detail, name='post_detail'), 
```

dashboards app views.py 

```def post_detail(request, slug):
    
    return render(request, 'dashboard/post_detail.html')
```

templates/dashboard/post_detail.html

``<h2> Post body detail</h2>
```



Hi @webextolcollege, from your snippet I see a small typo:

path('posts<slug:post_slug>/', views.post_detail, name='post_detail'),

should be

path('posts/<slug:post_slug>', views.post_detail, name='post_detail'),

to respond to the URL you are writing.

1 Like