我使用标准的Django评论框架。我没有错误,但没有看到评论表。为什么呢?
详细信息帖子模板:
{% extends 'base.html' %}
{% block head_title %}{{ post_detail.title }}{% endblock %}
{% block title %}{{ post_detail.title }}{% endblock %}
{% load comments %}
{% block content %}
{{ post_detail.body }}
{% endblock %}
{% block comments %}
{% for post in post_detail %}
{% get_comment_list for post as comment_list %}
{% render_comment_form for post %}
{% for comment in comment_list %}
{{ comment.comment }}
{% endfor %}
{% endfor %}
{% endblock %}
查看:
def view_post(request, slug):
post_detail = get_object_or_404(Blog, slug=slug)
return render_to_response('view_post.html', {
'post_detail': post_detail
})