django 您看到此页面是因为DEBUG=True位于您的设置文件中,而您尚未配置任何URL

9lowa7mx  于 2022-11-18  发布在  Go
关注(0)|答案(2)|浏览(597)

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')
aemubtdh

aemubtdh1#

您可能没有将您的应用(meetups)添加到settings.INSTALLED_APPS中,该应用可以在your_project_name/settings.py中找到。

h79rfbju

h79rfbju2#

meetups/templates/index.html更改为meetups/index.html,同时在您的urlpatterns中添加name

相关问题