溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Django中創(chuàng)建引擎索引出現(xiàn)報(bào)錯(cuò)如何解決

發(fā)布時(shí)間:2021-06-17 16:34:51 來(lái)源:億速云 閱讀:199 作者:Leah 欄目:開發(fā)技術(shù)

Django中創(chuàng)建引擎索引出現(xiàn)報(bào)錯(cuò)如何解決,相信很多沒(méi)有經(jīng)驗(yàn)的人對(duì)此束手無(wú)策,為此本文總結(jié)了問(wèn)題出現(xiàn)的原因和解決方法,通過(guò)這篇文章希望你能解決這個(gè)問(wèn)題。

具體報(bào)錯(cuò)如下:

執(zhí)行命令:

python3 manage.py rebuild_index

報(bào)如下錯(cuò)誤:

......(前面一堆報(bào)錯(cuò))
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.

可以看到以上報(bào)錯(cuò)中第2行代碼:

url(r'^admin/', include(admin.site.urls)),

網(wǎng)上查詢后,將項(xiàng)目路徑下的urls.py文件的這一行代碼改為:

url(r'^admin/', admin.site.urls),

再次執(zhí)行python3 manage.py rebuild_index,不再報(bào)錯(cuò).

Django中創(chuàng)建引擎索引出現(xiàn)報(bào)錯(cuò)如何解決

看完上述內(nèi)容,你們掌握Django中創(chuàng)建引擎索引出現(xiàn)報(bào)錯(cuò)如何解決的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI