Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.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 我想显示一个简单的';你好';在vscode中使用django通过服务器发送消息,但它表示找不到页面_Python_Django_Visual Studio Code - Fatal编程技术网

Python 我想显示一个简单的';你好';在vscode中使用django通过服务器发送消息,但它表示找不到页面

Python 我想显示一个简单的';你好';在vscode中使用django通过服务器发送消息,但它表示找不到页面,python,django,visual-studio-code,Python,Django,Visual Studio Code,我想在服务器上显示一个简单的hello,但收到一个错误,因为找不到页面 这是我的代码: 解析_web.url.py from django.contrib import admin from django.urls import include, path urlpatterns = [ path(r'jas/', include('website.urls')), path('admin/', admin.site.urls), ] website.url.py: fro

我想在服务器上显示一个简单的hello,但收到一个错误,因为找不到页面

这是我的代码: 解析_web.url.py

from django.contrib import admin
from django.urls import include, path 

urlpatterns = [
    path(r'jas/', include('website.urls')),
    path('admin/', admin.site.urls),
]
website.url.py:

from django.urls import path
from . import views

urlpatterns = [
    path(r'jas/', views.home, name='home'),
]
views.py:

from django.shortcuts import render
from django.http import HttpResponse

def home(request):
    return render(request, '/templates/website/home.html' )
home.html:

<h1>Helllllllloooooooooowwwwwwwwwwwww</h1>
helllllllooowwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

在website.url.py中,尝试:

path('', views.home, name='home'),
path('jas/', include('website.urls')),
而不是这个

path(r'jas/', views.home, name='home'),
path(r'jas/', include('website.urls')),
在analysis_web.url.py中,尝试:

path('', views.home, name='home'),
path('jas/', include('website.urls')),
而不是这个

path(r'jas/', views.home, name='home'),
path(r'jas/', include('website.urls')),

希望这会有所帮助。

您要拨打什么链接?我认为/jas/jas应该有效