您的位置: 首页 > 文章 > Django框架使用时候报type object 'BookInfo' has no attribute 'objects' Django框架使用时候报type object 'BookInfo' has no attribute 'objects' 分类: 文章 • 2023-03-04 23:46:10 Django框架使用时候报type object 'BookInfo' has no attribute 'objects' 具体原因如下 models 具体原因如下 在django框架中模型models里面使用自定义管理,从而导致默认objects被替代了,所以会报错,还有一种就是写错了大家都知道 models 解决该错误的方法: 1.把books = BookInfoManager()注释掉 2.或者将objects改为books