urls.py下的包含方法不起作用:Django

问题描述 投票:0回答:2
from django.contrib import admin
from django.urls import path, include
from pages import views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', views.index, name='index'),
    path('dashboard/', include(pages.urls)),
]

我正在尝试使用urls.py文件下的include方法将dashboad /请求定向到我的应用urls.py文件,该文件不起作用。

<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS9iaUgwTS5wbmcifQ==” alt =“ >

从django.contrib从django.urls导入路径导入管理员,包括从页面导入视图urlpatterns = [path('admin /',admin.site.urls),path('',views.index,name ='index '),路径('...

python django django-views pycharm
2个回答
4
投票

更改此行:


0
投票

您好,欢迎来到StackOverflow!

© www.soinside.com 2019 - 2024. All rights reserved.