我正在使用 python 3.8,启动服务器时出现错误:
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/
Using the URLconf defined in djangoProject.urls, Django tried these URL patterns, in this order:
polls/
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.
Run Code Online (Sandbox Code Playgroud)
我的民意调查/urls.py:
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
] …Run Code Online (Sandbox Code Playgroud)