title: Make success message disappear after few seconds of django form submission and display empty form
body: <p>I have a Django form where the person needs to add their details to subscribe and I want the page to show successful submission message  below the submit button for few seconds (lets say 3) and then it should disappear and the form fields should be displayed empty.</p>
  
  <p>The function definition in views.py is as follows :</p>
  
  <pre class="lang-py prettyprint-override"><code>def new_customer(request):
      if request.method == "POST":
          form = customer_form(request.POST)
  
          if form.is_valid():
              form.save() 
              messages.add_message(request, message_constants.SUCCESS, '✔️ SUCCESSFUL SUBSCRIPTION')
  
              return HttpResponseRedirect('http://127.0.0.1:8000/subscribe/')
  
      else:
          form = customer_form()
      return render(request,"new_customer.html",{'form':form})
  
  </code></pre>
  
  <p>The Django template :</p>
  
  <pre><code>
  {% load static %}
  &lt;!DOCTYPE html&gt;  
  &lt;html lang="en"&gt;  
  &lt;head&gt;  
      &lt;meta charset="UTF-8"&gt;  
      &lt;title&gt;Subscribe&lt;/title&gt;
      &lt;link href="https://fonts.googleapis.com/css?family=Poppins&amp;display=swap" rel="stylesheet"&gt;
      &lt;link href="{% static "nav.css" %}" rel="stylesheet"&gt;
      &lt;link href="{% static "form.css" %}" rel="stylesheet"&gt;
  
  &lt;/head&gt;
  {% include "navbar.html" %}
  &lt;body&gt;
  
  &lt;form method="POST" class="post-form" enctype="multipart/form-data"&gt;{% csrf_token %}  
          {{ form.as_p }}  
          &lt;button type="submit" class="btn"&gt;Subscribe&lt;/button&gt;  
          {% if messages %}
          &lt;ul id ="successMessage" class="messages"&gt;
              {% for message in messages %}
              &lt;li{% if message.tags %} class="{{ message.tags }}"{% endif %} style="color:green; font-size: 20px; list-style-type: none;"&gt;{{ message }}&lt;/li&gt;
              {% endfor %}
          &lt;/ul&gt;
  
  
          {% endif %}
  &lt;/form&gt;  
  
  &lt;/body&gt;  
  &lt;/html&gt;  
  </code></pre>
  
  <p>The current code helps display the message for successful submission, as well as empty form fields but does not make it disappear.
  Could anyone help ?</p>