django 錯誤集合

2021-08-11 08:22:28 字數 943 閱讀 4291

外來鍵檢查

報錯:1452, 'cannot add or update a child row: a foreign

keyconstraint fails

解決方法:

在setting檔案的databases中新增以下**取消外來鍵檢查

databases =

2,埠占用

啟動django報錯: django error: [errno 10013]

解決方法:關閉一些軟體,或更改啟用的埠。

3,pip 安裝:read timeout

報錯:read timeout

解決方法:更換pip源(個人喜歡使用豆瓣的)

pip國內映象目前有:

.com/ 豆瓣

.com/ 華中理工大學

.org/ 山東理工大學

.ustc

.edu

.cn/ 中國科學技術大學

1)手動指定源:

在 pip 後面跟-i 來指定源,比如安裝django1.9:

.com (注意後面要有 /****** 目錄 )\

2)配置檔案修改源

需要建立或修改配置檔案( linux 的檔案在~/.pip/pip.conf , windows 在%homepath%\pip\pip.ini ),修改內容為:

django常見錯誤

1.報錯 could not parse the remainder or from next or 原因 一般是template即html 中出了錯,例如我的,如圖 這份原本是我flask的前端 我複製來django的忘了修改,django不支援在 中出現單引號。解決辦法 對應刪除或修改 原因 1...

django常見錯誤

1.報錯 could not parse the remainder or from next or 原因 一般是template即html 了錯,例如我的,如圖 這份原本是我flask的前端 我複製來django的忘了修改,django不支援在 現單引號。解決辦法 對應刪除或修改 原因 1 可能是...

錯誤分析集合

1 the method find and modity text view from the type textactivity is never used locally 需要在oncreate 中宣告 2 出現程式強制關閉,可能是由於沒有宣告activity 3 如果按鈕出現在本地不可能呼叫的...