Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

The empty path didn’t match any of these

I am very new in Django & trying to run my first project. But stucked in the error "The empty path didn’t match any of these." as mentioned above. 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 of this question & found suggestion that not working for me.Seeking help to dig into the error.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Here is the full error tracbac:

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.

>Solution :

update this:

from django.urls import path
from . import views

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

to the following:

from django.urls import path
from . import views

urlpatterns=[
path('',views.members,name='members'),
]
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading