This is my Code ..
urlpatterns =[
path('',views.School_Lview.as_view(),name='list'),
path('(?P<pk>\d+)/',views.School_Dview.as_view(),name='detail')
]
I am trying to get this template to work
{% for school in schools %}
<h2><li><a href="{{school.id}}"> {{school.name}}</a></li></h2>
{% endfor%}
I Fixed it...I used re_path instead of path and it worked like a charm..
re_path('(?P<pk>\d+)/',views.School_Dview.as_view(),name='detail')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With