[Python] 404 Error: "The empty path didn’t match any of these"

Discussão em 'Python' iniciado por Stack, Agosto 17, 2025.

  1. Stack

    Stack Membro Participativo

    I am very new in Django & trying to run my first project. But I am stuck with this error:


    The empty path didn’t match any of these.
    ​

    In my app urls I have the following code:

    from django.urls import path
    from . import views

    urlpatterns=[
    path('members/',views.members,name='members'),
    ]


    And in my project urls I have the following code:

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

    urlpatterns = [
    path('', include('members.urls')),
    path('admin/', admin.site.urls),
    ]


    I read a number of answers to this question, but the suggestions did not work for me. Seeking help to dig into the error.

    Here is the full error traceback:

    Page not found (404)
    Request Method: GET
    Request URL: http://127.0.0.1:8000/
    Using the URLconf defined in my_tennis_club.urls, Django tried
    these URL patterns, in this order:

    members/ [name='members']
    admin/
    The empty path didn’t match any of these.

    You’re seeing this error because you have DEBUG = True in your
    Django settings file. Change that to False, and Django will display
    a standard 404 page.

    Continue reading...

Compartilhe esta Página