【问题标题】:Using the URLconf defined in crm1.urls, Django tried these URL patterns, in this order:使用 crm1.urls 中定义的 URLconf,Django 按以下顺序尝试了这些 URL 模式:
【发布时间】:2021-02-14 03:30:04
【问题描述】:

嗨,我是 django 的新手,我想知道为什么 django 会说“使用 crm1.urls 中定义的 URLconf,Django 按以下顺序尝试了这些 URL 模式:

管理员/ 当前的路径,大约,与这些都不匹配。” 网址文件:

from django.urls import path

from django.http import HttpResponse

def home(request):
    return HttpResponse('Home page')

def contact(request):
    return HttpResponse('contact page')

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', home),
    path('about/',contact),
]

我正在关注 youtube 上的教程,到目前为止,这就是那个人告诉我要写的全部内容-

谢谢你

【问题讨论】:

    标签: python django


    【解决方案1】:

    您在“主页”和“联系人”之间请求哪个页面?

    【讨论】:

      猜你喜欢
      • 2021-04-13
      • 2017-05-27
      • 2017-06-26
      • 2020-05-05
      • 1970-01-01
      • 2018-06-28
      • 2020-08-02
      • 1970-01-01
      • 2020-09-01
      相关资源
      最近更新 更多