Django之創(chuàng)建引擎索引報(bào)錯(cuò)及解決詳解
學(xué)習(xí)Django框架時(shí),創(chuàng)建一個(gè)引擎及索引時(shí)報(bào)錯(cuò),具體報(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)上查詢(xún)后,將項(xiàng)目路徑下的urls.py文件的這一行代碼改為:
url(r'^admin/', admin.site.urls),
再次執(zhí)行python3 manage.py rebuild_index,不再報(bào)錯(cuò).

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
用Python復(fù)現(xiàn)二戰(zhàn)德軍enigma密碼機(jī)
大家好,本篇文章主要講的是用Python復(fù)現(xiàn)二戰(zhàn)德軍enigma密碼機(jī),感興趣的同學(xué)趕快來(lái)看一看吧,對(duì)你有幫助的話(huà)記得收藏一下,方便下次瀏覽2022-01-01
TensorFlow基本的常量、變量和運(yùn)算操作詳解
今天小編就為大家分享一篇TensorFlow基本的常量、變量和運(yùn)算操作詳解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-02-02
Python如何爬取51cto數(shù)據(jù)并存入MySQL
這篇文章主要介紹了Python如何爬取51cto數(shù)據(jù)并存入MySQL,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-08-08
python實(shí)現(xiàn)k-means聚類(lèi)算法
這篇文章主要為大家詳細(xì)介紹了python實(shí)現(xiàn)k-means聚類(lèi)算法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-02-02
淺析Python中的弱引用與基礎(chǔ)類(lèi)型支持情況
最近有一個(gè)業(yè)務(wù)場(chǎng)景需要用Python自行實(shí)現(xiàn)一個(gè)簡(jiǎn)單的LRU cache,不可避免的接觸到了弱引用這一概念,所以下面就來(lái)和大家分享一下相關(guān)的知識(shí)吧2023-07-07
Tortoise-orm信號(hào)實(shí)現(xiàn)及使用場(chǎng)景源碼詳解
這篇文章主要為大家介紹了Tortoise-orm信號(hào)實(shí)現(xiàn)及使用場(chǎng)景源碼詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-03-03

