Python django服务器未显示任何结果
我开始研究django(阅读django文档和一些youtube教程) 我不明白怎么回事,编辑器没有显示任何错误(VSCode)。 当我启动服务器时,它会显示默认的火箭图标…我尝试重新安装django,但也没有帮助…还多次重新启动服务器。 我现在被卡住了。 主url文件 应用程序的url文件(calc) 查看应用程序的文件Python django服务器未显示任何结果,python,django,visual-studio-code,Python,Django,Visual Studio Code,我开始研究django(阅读django文档和一些youtube教程) 我不明白怎么回事,编辑器没有显示任何错误(VSCode)。 当我启动服务器时,它会显示默认的火箭图标…我尝试重新安装django,但也没有帮助…还多次重新启动服务器。 我现在被卡住了。 主url文件 应用程序的url文件(calc) 查看应用程序的文件 from django.shortcuts import render from django.http import HttpResponse # Create your
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def home(request):
return HttpResponse("Hello World")
将calc应用程序中的url路径编辑到以下位置。
路径(“”,views.home,name='index')将calc应用程序中的url路径编辑到下面。
path(“”,views.home,name='index')您的calc.views.py中没有名为index的函数,对吗?您应该将其更新为views.home,因为您的calc.views.py中没有名为index的函数,对吗?您应该将其更新为views.home IMO
from django.urls import path
from . import views
urlpatterns = [
path('',views.index,name='index')
]
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def home(request):
return HttpResponse("Hello World")