【发布时间】:2020-05-19 23:18:47
【问题描述】:
在我的 django rest 框架应用程序中,我有 Urls.py 如下:
from django.urls import include, path
from .shipper import*
from .views import *
urlpatterns = [path('shipper/',
include(path('shipperitems/', MasterItemsList.as_view()),
path('shippercreateapi/', shipperCreateAPIView.as_view()),)),
]
当我尝试运行该应用程序时,它给了我以下错误:
django.core.exceptions.ImproperlyConfigured:在 不支持不提供 app_name 的 include()。设置 包含模块中的 app_name 属性,或传递 2 元组 而是包含模式列表和 app_name。
我应该怎么做才能解决这个问题?
【问题讨论】:
-
在学习
djangorestframework时遇到同样的问题。似乎来自 rest_framework 的教程已经过时了。 django-rest-framework.org/tutorial/quickstart/#urls
标签: django python-3.x django-rest-framework django-urls