2👍
✅
urls.py:
from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name="home"),
path('delete/<int:list_id>/', views.delete, name="delete"),
]
You need to specify the int
type in the url.
And also the trailing /
1👍
You need a regular expression to say a number is coming
path('delete/(?P<list_id>)[\d]+)/$', views.delete, name="delete"),
- [Django]-Return one-to-one model information with model in Django
- [Django]-Block invalid HTTP_HOST headers in Apache in AWS ElasticBeanstalk
- [Django]-Dynamically add to TEMPLATE_DIRS at runtime with a Django project
Source:stackexchange.com