user642958
user642958

Reputation: 129

Django: Comment post not allowed (400) Error

i am trying to use django comments on my web application but I get this error:

Comment post not allowed (400) Why: Missing content_type or object_pk field.

I am using the following form:

<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>

but when i use the automatically generated form by django

{% render_comment_form for event %}

everything works fine. the problem is, i don't want the Name/E-Mail/etc.-Input fields. Only the comment textarea. can someone help me with this problem?

greets

Upvotes: 1

Views: 1232

Answers (1)

phunehehe
phunehehe

Reputation: 8778

The error message makes it quite clear: you probably failed to include content_type or object_pk when rendering your form. Check in your rendered form that you have those fields. Maybe you will find the problem after reading Notes on the comment form.

Upvotes: 3

Related Questions