【发布时间】:2011-07-11 01:19:29
【问题描述】:
我正在尝试在我的 Web 应用程序上使用 django cmets,但出现此错误:
不允许发表评论 (400) 原因:缺少 content_type 或 object_pk 字段。
我正在使用以下表格:
<form action="{% comment_form_target %}" method="POST">
{% for field in form %}
{% if field.is_hidden %}
{{ field }}
{% endif %}
{% endfor %}
<input type="hidden" name="name" value="{{ user }}" />
<input type="text" name="honeypot" size="64" style="display: none;" />
<textarea id="id_comment" rows="1" cols="40"
name="comment"></textarea>
<input type="submit" name="submit" class="submit-post" value="Post" />
</form>
但是当我使用 django 自动生成的表单时
{% render_comment_form for event %}
一切正常。问题是,我不想要 Name/E-Mail/etc.-Input 字段。只有评论文本区域。有人可以帮我解决这个问题吗?
问候
【问题讨论】:
标签: django