How to pass parameter in url?
You can pass parameters in Django URLs like this
path('test/<int:post_id>',views.index, name='index'),
Here post_id is the parameter you can use yours.
<int:> is for integers and <str:> is for strings
I have a task in which in have to create view.py, template, url.py and model.py in django, In which I have four Button D1, D2, D3, D4 in template.
When I click on D1 it should redirect me to a page whose link is:
http://127.0.0.1:8000/uploads/test/**D1**
And while clicking on D2 link redirects me one same page and link is http://127.0.0.1:8000/uploads/test/**D2**
Similarly while clicking on D2 and D3 links are
http://127.0.0.1:8000/uploads/test/**D3** and http://127.0.0.1:8000/uploads/test/**D4**