Вы можете передать идентификатор комментария в своем методе публикации.
{% for comment in comments.all %}
{# Displaying the coment here #}
<form action="{% url 'comment_view' comment.id %}" method="POST">
{% csrf_token %}
{{ comment_form.as_p }}
<p><input type="submit" value="Comment"></p>
</form>
{% endfor %}
urls.py
path('comment-view/<int:id>', views.comment_view, name="comment_view")
views.py
def comment_view(request, id):
print('Comment id is ', id)
return render(request, 'your-template' }