[Answer]-Django Form Submit Update HTML

1👍

You can use the messages framework:

if form.is_valid():
    messages.success(request, 'Success!')
    return HttpResponseRedirect('/contact/')

And then in the template:

{% if messages %}
    {% for message in messages %}
        <p>{{ message }}</p>
    {% endfor %}
{% endif %}

More advanced template can be found in the documentation.

Leave a comment