You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.29 05:32:54