The code in the book (and here) contains a bug - after posting a comment, refreshing the page (F5) causes the same comment to be posted again, as many times as we refresh. A solution to this problem could be a HttpResponseRedirect using the respective post's get_absolute_url.
The code in the book (and here) contains a bug - after posting a comment, refreshing the page (F5) causes the same comment to be posted again, as many times as we refresh. A solution to this problem could be a HttpResponseRedirect using the respective post's get_absolute_url.