原文:'bool' object is not callable

使用 Django自帶的 auth 用戶驗證功能,編寫函數,使用 is authenticated 檢查用戶是否登錄,結果報錯: TypeError at bool object is not callable 編寫函數如下: 查詢相關資料,發現 is authenticated 是屬性而不是方法,我們應該把括號去掉,這樣就沒什么問題了。 將 if request.user.is authenti ...

2020-12-11 13:34 1 2992 推薦指數:

查看詳情

Django 錯誤:TypeError at / 'bool' object is not callable

使用 Django自帶的 auth 用戶驗證功能,編寫函數,使用 is_authenticated 檢查用戶是否登錄,結果報錯:   TypeError at / 'bool' object is not callable   編寫函數如下: 查詢相關資料,發現 ...

Thu Jul 12 19:44:00 CST 2018 0 6384
TypeError: 'module' object is not callable

TypeError: 'module' object is not callable Person.py object_to_json.py 運行object_to_json.py時報錯: Traceback (most recent call last): ​ File "E ...

Thu Dec 31 03:29:00 CST 2020 0 1691
錯誤:'dict' object is not callable

在晚上學習別人的代碼,偶然爆出錯誤:'dict' object is not callable 找了半天沒發現錯誤。后來還想上文已經有變量名為dict. 因此dict在下面程序中被認為是一個變量不是內置函數。 教訓:不要將變量名取名為關鍵字。 ...

Sun Oct 01 02:00:00 CST 2017 0 4479
TypeError: 'NoneType' object is not callable

None類型不是一個可以可以調用(callable)對象 賦值語句錯誤,值為None callable對象是指一個后面可以加()的對象,一般把調用函數時()去掉 ...

Tue Jan 08 06:54:00 CST 2019 0 15515
python 'list' object is not callable

stackoverflow中解釋 :you've written li(m) instead of li[m].This means you're trying to call lista2 like ...

Mon Dec 02 06:18:00 CST 2019 0 2069
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM