{% if echo %}
<form method="post" action="{% url 'homepage:echo_submit' %}">
    {% else %}
    <form method="post">
        {% endif %}
        {% csrf_token %}
        {% for field in form.visible_fields %}
        <div class="mb-3 form_item {% if field.widget_type == 'checkbox' %}form-check{% endif %}">
            <label for="{{ field.id_for_label }}" class="form-label">{{ field.label }}</label>
            {{ field }}
            {% if field.help_text %}
            <div class="form-text">{{ field.help_text }}</div>
            {% endif %}
        </div>
        {% endfor %}
        <button type="submit" class="btn btn-primary">{% if text_button %} {{ text_button }} {% else %} Отправить {% endif %}
        </button>
    </form>
</form>
