The current path, products/ didn't match any of these

I am watching a Django tutorial from PROGRAMMING WITH MOSH on YouTube however even though my code is exactly the same as shown in the video for some reason I get this message: The current path, products/, didn’t match any of these. I am using python 3.1 and Django 4.1.4, here is my code:

PyShop/products/views.py`

from django.http import HttpResponse
from django.shortcuts import render

# URL ----> Uniform resourse locator

def index(request):
    return HttpResponse('Hello world ')

PyShop/pyshop/urls.py `

from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path("admin/", admin.site.urls),
    path("products/", include ('products.urls'))

PyShop/products/urls.py `

from django.urls import path
from . import views


urlpatterns = [
    path (' ', views.index)

]

I was expecting to get a message saying hello world when I type products/ in the search bar. I rewatch the tutorial a couple of times and I am pretty sure that I have the same code as the person on the tutorial `

Back to Top