Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我看来:
posts = Post.objects.all() print len(posts)
打印“2”
在我的模板中
{{ posts|length }}
在浏览器中导致“0”
1)你确定,这些帖子在模板中可用吗?2)为什么不使用计数?