class CommentCreate(CreateView):
model = Comment
template_name = "post_detail.html" # какой шаблон использовать
success_url = "ссылка на пост блога" # редирект на пост
def get_context_data(self, **kwargs): # передача формы
context = super(CommentCreate, self).get_context_data(**kwargs)
context['comment'] = CommentForm()
return context
<form action="" method='post'>
{% csrf_token %}
<table>
{{ comment.as_p }}
</table>
<input type='submit' name="submit" value='Submit' />
</form>
{% endblock %}
12:29:06.342370 IP 192.168.251.25 > 192.168.250.102: ICMP echo request, id 38152, seq 4, length 64
12:29:06.402197 IP 192.168.250.102 > 192.168.251.25: ICMP echo reply, id 38152, seq 4, length 64
.tcpdump -i tun0 proto ICMP
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun0, link-type RAW (Raw IP), capture size 65535 bytes
12:07:32.998919 IP 192.168.243.1 > 192.168.250.102: ICMP echo request, id 29704, seq 73, length 64