form
{% comment %} Fancy Form. Nice, simple, htmx powered. django-tweaks for field render {% endcomment %} {% comment %} Make sure your view returns a form. Specify view_name {% endcomment %} {% load widget_tweaks %} <form class="bg-gray-200" hx-post="{% url view_name %}" @htmx:after-request="location.reload()" {{ attrs }}> <div class="flex flex-col"> {% for field in form %} <label for="{{ field.id_for_label }}" class="">{{ field.label }}</label> {% render_field field class="bg-gray-100" %} {% endfor %} <button type="submit" class="hover:bg-fuchsia-400 hover:cursor-pointer">Save word</button> </div> </form>