In the previous lesson, you learned how to pull one specific resource out of your database. Now you need to build that code into your views and set up the correct routing so that you’ll be able to see the details page of one of your projects.
In urlpatterns in your projects app, you had an empty path that just went to projects without anything afterwards and then rendered your all_projects view. Now, you need to add a second path:
urlpatterns = [
path('', views.all_projects),
path('<int:pk>', views.project_detail)
]
You can use the characters < and > to captures a part of a URL and pass it forward into your app.
Martin Breuss RP Team on May 26, 2020
Hi @vivekdeo you’ve stumbled across a subtle typo: one superfluous
"s"!In your view function you’re passing the data on to your template with the key name
projects. This key name is how you will be able to access it in your template. However, in your template you are trying to access the data via the keyproject(without thesat the end).So you just need to keep in mind that the key in your
contextdictionary and thevariable namethat you use to access the data under in your template match up.