Specifying a namespace in include() without providing an app_name is not supported.

報錯信息:

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'
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章