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)), ]
我正在尝试从页面目录(在Django中是一个应用程序)导入视图,例如“从页面导入视图”,但这不起作用。
<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS9iaUgwTS5wbmcifQ==” alt =“ >
从django.contrib从django.urls导入路径导入管理员,包括从页面导入视图urlpatterns = [path('admin /',admin.site.urls),path('',views.index,name ='index '),路径('...
更改此行:
path('dashboard/', include(pages.urls)),
您好,欢迎来到StackOverflow!