Django之創(chuàng)建引擎索引報錯及解決詳解
更新時間:2019年07月17日 15:35:55 作者:GYT0313
這篇文章主要介紹了Django之創(chuàng)建引擎索引報錯及解決詳解,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友可以參考下
學習Django框架時,創(chuàng)建一個引擎及索引時報錯,具體報錯如下:
執(zhí)行命令:
python3 manage.py rebuild_index
報如下錯誤:
......(前面一堆報錯) File "/home/python/Django/test6/test6/urls.py", line 20, in <module> url(r'^admin/', include(admin.site.urls)), File "/home/python/.virtualenvs/py_django/lib/python3.6/site-packages/django/urls/conf.py", line 27, in include 'provide the namespace argument to include() instead.' % len(arg) django.core.exceptions.ImproperlyConfigured: Passing a 3-tuple to include() is not supported. Pass a 2-tuple containing the list of patterns and app_name, and provide the namespace argument to include() instead.
可以看到以上報錯中第2行代碼:
url(r'^admin/', include(admin.site.urls)),
網(wǎng)上查詢后,將項目路徑下的urls.py文件的這一行代碼改為:
url(r'^admin/', admin.site.urls),
再次執(zhí)行python3 manage.py rebuild_index,不再報錯.
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
numpy 矩陣形狀調(diào)整:拉伸、變成一位數(shù)組的實例
這篇文章主要介紹了numpy 矩陣形狀調(diào)整:拉伸、變成一位數(shù)組的實例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-06-06python打包exe文件并隱藏執(zhí)行CMD命令窗口問題
這篇文章主要介紹了python打包exe文件并隱藏執(zhí)行CMD命令窗口問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-01-01