0
我使用standart django評論框架。Django:空評論表單錯誤處理
模板:
<h2>Add comment</h2> {% get_comment_form for post as form %}
<form action="{% comment_form_target %}" method="post" > {% csrf_token %}
{{form.content_type}}{{form.object_pk}}{{form.timestamp}}{{form.security_hash}}
Comment:<br />
{{form.comment}}
<input type="hidden" name="next" value="{{ request.get_full_path }}#comment" />
<button class="btn btn-large btn-primary" type="submit">Post</button>
</form>
網址:
(r'^comments/', include('django.contrib.comments.urls')),
然後我送空的形式,我重定向到/評論/後/頁。 如何重新加載當前頁面並添加錯誤消息?謝謝!