0

I've been using Django since Django 1, and I've always used the same URL patterns (except when we switched from url to path).

Now I'm having an issue with 404 errors. I'll give you my Project URLS, and App URLS, and you tell me what am I doing wrong:

Project:

urlpatterns = [
    path('b/', include('booking.urls')),
]

Booking App:

urlpatterns = [
    path('book/<int:s>/<str:d>/', views.book, name="book"),
    path('fb/', views.finalize_booking, name="finalize_booking"),
]

When I try to call {% url "finalize_booking" %}, it gives me a 404 error.

Kaiss B.
  • 249
  • 1
  • 12

1 Answers1

0

You should add forward slash at the start of of your string.

urlpatterns = [
path('/book/<int:s>/<str:d>/', views.book, name="book"),
path('/fb/', views.finalize_booking, name="finalize_booking"),]
  • No, actually it is not the solution. The beginning of the slash should actually be the trailing slash in the previous root. But thank you for answering. – Kaiss B. Apr 01 '22 at 17:31