django 运行报错:某个class 没有 objects 属性问题?及解决方案。

来源:互联网 发布:mac os x系统官网下载 编辑:程序博客网 时间:2024/05/21 04:44

遇到问题:在学习追梦人技术博客中,遇到 Post 类中没有 objects 属性,不能成功显示界面信息?

报错图片如下图,



解决方法:

在models.py 中Post 类中添加 “ objects = models.Manager() "  即可!

阅读全文
0 0
原创粉丝点击