django URLconf current path didn't match

1,628 views
Skip to first unread message

Usman Gill

unread,
Mar 10, 2018, 8:31:34 AM3/10/18
to Django users

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

polls/ [name='index']
admin/

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


My code is... from (app)polls urls.py


from django.urls import path
from . import views


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

from (project)mysite urls.py

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


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

]

from views.py project file

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

def index(request):
    return HttpResponse("Hello world, you are at the polls index.")

Jason

unread,
Mar 11, 2018, 8:09:33 AM3/11/18
to Django users
and you're getting this from the URL localhost:8000/polls/ ?
Reply all
Reply to author
Forward
0 new messages