报错信息:
Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.
根据报错信息,app_name应该是 chatterbot_urls 里的属性(attribute),在app目录下的urls.py文件中直接定义这个变量app_name,并赋值为你的app名称即可。
你上传的这个urls.py应该是项目目录中的。以下是我的app目录下的urls.py的内容:
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), ] app_name = 'users'
本文介绍了解决Django项目中包含应用命名空间错误的方法。通过在应用的urls.py文件中设置app_name变量,可以避免错误:'Specifying an namespace in include() without providing an app_name is not supported.' 示例代码展示了如何正确配置。
1万+

被折叠的 条评论
为什么被折叠?



