{% if not fields_only %}
    <form
            action="{{ action_url }}"
            method="{{ form_method }}"
            enctype="multipart/form-data"
    >
    {% csrf_token %}
{% endif %}
    {% for error in form.non_field_errors %}
        <p class="error">{{ error }}</p>
    {% endfor %}

    {% for field in form %}
        {{ field.error }}
        {{ field.label }}
        {{ field }}<br>
    {% endfor %}
{% if not fields_only %}
    <input type="submit" value="{{ button_text|default:"Submit" }}">
    </form>
{% endif %}
