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

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

2018-07-12 11:44 0 6384 推薦指數:

查看詳情

Python 運行錯誤TypeError: 'module' object is not callable

這是錯誤修正后的截圖 在修正問題之前使用 from pageObjects import LoginPage   就拋出Error TypeError: 'module' object is not callable. 仔細想想也是有道理的, 因為一個py文件 ...

Sun Aug 09 00:20:00 CST 2020 0 3085
'bool' object is not callable

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

Fri Dec 11 21:34:00 CST 2020 1 2992
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
TypeError: 'NoneType' object is not callable

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

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

TypeError:'dict' object is not callable 出現這種錯誤有兩種可能: 1. 代碼里重新定義了dict,比如 dict= {...},這時調用的是代碼里定義的dict而不是python內置類型 2. 取字典內容時用了 ...

Tue Sep 05 05:21:00 CST 2017 0 5825
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM