Python 我想显示一个简单的';你好';在vscode中使用django通过服务器发送消息,但它表示找不到页面
我想在服务器上显示一个简单的hello,但收到一个错误,因为找不到页面 这是我的代码: 解析_web.url.pyPython 我想显示一个简单的';你好';在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
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应该有效