Djangoチュートリアルviewの作成で指示通りにコードを書いても404エラーが出てしまいます。
発生している問題・エラーメッセージ
エラーメッセージ
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/polls/
Using the URLconf defined in config.urls, Django tried these URL patterns, in this order:
admin/
The current path, polls/, 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.
ディレクトリ
polls/
init.py
admin.py
apps.py
migrations/
init.py
models.py
tests.py
urls.py
views.py
該当のソースコード
views
1from django.contrib import admin 2from django.http import HttpResponse 3 4 5def index(request): 6 return HttpResponse("Hello, world. You're at the polls index.")
polls
urls
1from django.urls import path 2 3from . import views 4 5urlpatterns = [ 6 path('', views.index, name='index'), 7]
mystic
urls
1from django.contrib import admin 2from django.urls import include, path 3 4urlpatterns = [ 5 path('polls/', include('polls.urls')), 6 path('admin/', admin.site.urls), 7]
試したこと
上記のコードで実行しました。
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。