我正在尝试使用评论框架在我的网站上实现评论。我遵循了文档:
https://docs.djangoproject.com/en/dev/ref/contrib/comments/
https://docs.djangoproject.com/en/dev/ref/contrib/comments/example/
我的模板看起来像:
{% extends "pbase.html" %}
{% load comments %}
{% block bcontent %}
<div class="main">
<a href="{{ backurl }}"><< back</a>
<!-- Image -->
<ul>
{% if image.title %}
<div class="title">{{ image.title }}</div>
{% endif %}
<ul>
<img border="0" alt="" src="{{ media_url }}{{ image.image.name }}" width="900" />
</ul>
</ul>
{% load comments %}
{% get_comment_count for photo.image object_pk as comment_count %}
<p>{{ comment_count }} comments have been posted.</p>
{% render_comment_list for photo.image object_pk %}
{% render_comment_form for photo.image object_pk %}
</div>
{% endblock %}
在我的页面上显示评论的数量,但不显示评论本身或表单。我错过了什么?
谢谢