Working through part 1 of the tutorial and am getting this error when trying to access polls in my internet browser:
"# Page not found (404)
Request Method: | GET |
---|---|
Request URL: | http://localhost:8000/polls/ |
Using the URLconf defined in mysite.urls
, Django tried these URL patterns, in this order:
- admin/
The current path, polls/
, didn’t match any of these."
I have triple checked my code, but here it is:
polls\urls.py
from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
]
mysite\urls.py
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path("polls/", include("polls.urls")),
path("admin/", admin.site.urls),
]
polls\views.py
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the polls index.")