Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python django服务器未显示任何结果_Python_Django_Visual Studio Code - Fatal编程技术网

Python django服务器未显示任何结果

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

我开始研究django(阅读django文档和一些youtube教程) 我不明白怎么回事,编辑器没有显示任何错误(VSCode)。 当我启动服务器时,它会显示默认的火箭图标…我尝试重新安装django,但也没有帮助…还多次重新启动服务器。 我现在被卡住了。

主url文件

应用程序的url文件(calc)

查看应用程序的文件

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")