Consistent Issue with correct URLS producing Page Not Found error

I am having a problem with my URLS in Django.

I should note I am working in Django 4, not 3.

Often, I receive a Page Not Found Error noting that "Using the URLconf defined in hallfame.urls , Django tried these URL patterns, in this order… (followed by a list of URLS on my urls.pty page, then…“The current path, current_path , didn’t match any of these.”

For the latest example, this URL is correctly coded, but it produces the error.

path('halloffame/int:pk/addvideo, views.add_video, name=‘add_video’),

Sometimes, I can add a forward slash after the path name, and it fixes the problem:

path(‘halloffame/int:pk/addvideo/’, views.add_video, name=‘add_video’),

But that quick fix is not working this time. I have reviewed the video twice, and my code several times. I do not see any typos or other issues that would cause the error. The website is otherwise fully functional up to this point in the course.

Is anyone out there who can shed some light on this issue?

It is consistently a problem, sometimes not.

This time, my quick fix is not working.

Thank you.

I figured out the problem. I forgot to enable to virtual environment.

Nope. The problem continues. I doubt anyone out there is listening. The URLS work fine as long as there is no “user number” in the url. Here is an example:

path(‘halloffame/int:pk/addvideo’, views.add_video, name=‘add_video’),

This url is written exactly as presented in the course, but it often does not work. I have checked and double-checked the views and other files. I don’t think there’s an error in the code. It has to be some setting somewhere in my computer causing this to happen.

If you’re out there, I really need some help.

Robert

Hey Robert

I know this post is a bit old but I have the same issue as well. Did you ever figure out what the problem was?