我正在上一门Django课程,并且在我的第一个教程中,我仅在映射URL时会看到“发现页面上出现404错误”。 我引用了此链接,并执行了相同的步骤,但仍然收到相同的错误。
https://docs.djangoproject.com/en/3.0/intro/tutorial01/
polls/urls.py
-------------
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
polls/view.py
-------------
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the polls 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),
]
帮我解决错误...我检查了所有来源并严格按照链接进行操作...仍然无法正常运行