Hello, why am I getting this error

33 views
Skip to first unread message

Samuel Nzola

unread,
Oct 26, 2022, 9:56:29 PM10/26/22
to Django users
Page not found (404)
Request Method:
GET
Request URL:
http://127.0.0.1:8000/delete-room/6/%3E

Using the URLconf defined in studybud.urls, Django tried these URL patterns, in this order:

  1. admin/
  2. [name='home']
  3. room/<str:pk>/ [name='room']
  4. create-room/ [name='create-room']
  5. update-room/<str:pk>/ [name='update-room']
  6. delete-room/<str:pk>/ [name='delete-room']

The current path, delete-room/6/>, didn’t match any of these.



here is my url.py in my project

from django.urls import URLPattern, path, include
from . import views

urlpatterns=[
    path('', views.home, name='home'),
    path('room/<str:pk>/', views.room, name="room"),
    path('create-room/', views.createRoom, name="create-room"),
    path('update-room/<str:pk>/', views.updateRoom, name="update-room"),
    path('delete-room/<str:pk>/', views.deleteRoom, name="delete-room"),
]

Samuel Nzola

unread,
Oct 27, 2022, 2:32:10 AM10/27/22
to Django users
Please help

Kasper Laudrup

unread,
Oct 27, 2022, 4:45:38 AM10/27/22
to django...@googlegroups.com
As the error message clearly states, the path:
> 6. delete-room/<str:pk>/ [name='delete-room']

doesn't match:

> The current path, delete-room/6/>, didn’t match any of these.

Documentation:

https://docs.djangoproject.com/en/4.1/topics/http/urls/

Kind regards,

Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature

Samuel Nzola

unread,
Oct 27, 2022, 7:59:36 AM10/27/22
to Django users
Thajnkyou, though i cannot fix the error still

Samuel Nzola

unread,
Oct 27, 2022, 9:37:44 AM10/27/22
to django...@googlegroups.com
Error fixed

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7dd41486-f1e8-475b-9506-b42a6365fe68n%40googlegroups.com.

Ryan Nowakowski

unread,
Oct 29, 2022, 8:44:18 AM10/29/22
to django...@googlegroups.com, Samuel Nzola
It looks like your request URL has a trailing '>'. That's what the %3E is. Get rid of that and try the request again?
Reply all
Reply to author
Forward
0 new messages