Django投票应用页面无法渲染,请求排查原因
我的首个Django投票应用无法访问http://localhost:8000/polls/
我正在通过Django教程创建首个投票应用(polls app)并学习Django。
以下是我目前创建的文件结构:
相关代码文件
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/urls.py
from django.urls import path from . import views urlpatterns = [ path("", views.index, name="index"), ]
polls/views.py
from django.http import HttpResponse def index(request): return HttpResponse("Hello, world. You're at the polls index.")
问题情况
我尝试访问http://localhost:8000/polls/,但页面无法正常显示,提示如下:
我已经尝试了各种调试方式,看起来所有配置都是正确的。我使用的是GitHub IDE,但我认为这应该不是问题所在。请问可能是什么原因?
内容的提问来源于stack exchange,提问作者susannaarwen
相关产品推荐
相关产品推荐

