post.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:Instagram 作者: Fastcampus-WPS-5th 项目源码 文件源码
def post_list_original(request):
    # ?? Post??? 'posts'?? key? context? ?? return render??
    # post/post_list.html? template?? ????? ??

    # ? ???? ?? ?? 4???? ??? ????? ???? ??
    # ? post??? CommentForm? ??? ???? ??? ????? ??

    # ??
    # 1. post_list? hashtag_post_list?? pagination? ????
    #    ? ?? 10??? ????? ??
    #   https://docs.djangoproject.com/en/1.11/topics/pagination/
    # 2. ??? ?? ?? ? ??? ? ?? ?? ??
    posts = Post.objects.all()
    context = {
        'posts': posts,
        'comment_form': CommentForm(),
    }
    return render(request, 'post/post_list.html', context)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号