作爲新的Django &嘗試一些有趣的我是stucked,我得到了錯誤:評論後不允許(400):缺少CONTENT_TYPE或object_pk場
Comment post not allowed (400): Missing content_type or object_pk field.
我form.html文件:
{% if user.is_authenticated %}
<form action="/comments/post/" method="post">{% csrf_token %}
<p><label>Post a comment:</label><br />
<textarea name="comment" rows="10"
cols="60"></textarea></p>
<input type="hidden" name="options"
value="{{ options }}" />
<input type="hidden" name="target" value="{{ target }}" />
<input type="hidden" name="gonzo" value="{{ hash }}" />
<input type="submit" name="post" value="submit comment" />
</form>
{% else %}
<p>Please <a href="/login/">log in</a> to post comments.</p>
{% endif %}
有人可以幫忙嗎?
顯示錯誤所在,從+全回溯未來將有助於找出問題的Python代碼。 –