欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Django之創(chuàng)建引擎索引報(bào)錯(cuò)及解決詳解

 更新時(shí)間:2019年07月17日 15:35:55   作者:GYT0313  
這篇文章主要介紹了Django之創(chuàng)建引擎索引報(bào)錯(cuò)及解決詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下

學(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)上查詢后,將項(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)文章

最新評(píng)論