{% if request.user.is_authenticated %}
{% csrf_token %}
{% else %}
Войдите, чтобы написать комментарий
{% endif %}