0

Here's the error I'm getting:

Page not found (404)
Request Method: GET
Request URL:    http://localhost:8000/bet/4/update
Using the URLconf defined in chessbet.urls, Django tried these URL patterns, in this order:
admin/[name='bet-home']
bet/<int:pk> [name='bet-detail']
bet/<int:pk>/update/> [name='bet-update']
about/ [name='bet-about']
bet/new/ [name='bet-create']
register/ [name='register']
login/ [name='login']
logout/ [name='logout']
yourprofile/ [name='yourprofile']

^media/(?P<path>.*)$

The current path, bet/4/update, didn't match any of these.

Now from what I see the current path is equivalent to the path I laid out for bet-update. What am I doing wrong here?

Here is my urls.py:

urlpatterns = [
    path('', BetListView.as_view(), name = "bet-home"),
    path("bet/<int:pk>", BetDetailView.as_view(), name="bet-detail"),
    path("bet/<int:pk>/update/>", BetUpdateView.as_view(), name="bet-update"),
    path('about/', views.about, name = "bet-about"),
    path("bet/new/", BetCreateView.as_view(), name="bet-create") 
]

Bet detail which does something very similar works fine but bet update does not.

Any help would be much appreciated.

1 Answer 1

2

It seems that you have odd /> in update path should be

    path("bet/<int:pk>/update", BetUpdateView.as_view(), name="bet-update"),
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.