the explorer in vscode获取错误:您看到此页面是因为DEBUG=True位于您的设置文件中,而您尚未配置任何URL。
聚会/urls.py
from django.urls import path
from . import views
urlpatterns = [
path('meetups/', views.index) #domain_name.com/meetups/
]
urls.py
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('meetups.urls'))
]
views.py
from django.shortcuts import render
# Create your views here.
def index(request):
return render(request,'templates/meetups/index.html')
2条答案
按热度按时间aemubtdh1#
您可能没有将您的应用(
meetups
)添加到settings.INSTALLED_APPS
中,该应用可以在your_project_name/settings.py
中找到。h79rfbju2#
将
meetups/templates/index.html
更改为meetups/index.html
,同时在您的urlpatterns
中添加name