Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<form action={% commment_form_target %}デフォルトのコメントフレームワークを使用しているときに、 (の一部{% .. %})はdjangoでどのように機能しますか?投稿後、アクションはどのビューに導かれますか?ドキュメントには「/comments/post」と書かれています。では、デフォルトのコメントフレームワークを機能させるには、ビュー投稿を含むコメントアプリを作成する必要がありますか?
<form action={% commment_form_target %}
{% .. %}
そのテンプレート タグは、post_comment ビューの逆方向に解決された URL を返すだけです。
デフォルトのビューは、コメント アプリ django.contrib.comments.view.post_comment にバンドルされています。カスタマイズしたい場合は、自分で作成する必要があります。アプリで get_form_target をオーバーライドして、reverse("customapp.post_comment") を返して独自のものを使用します。