title: Show a successful message with Class Based Views
body: <p>I, want show a successful message when a row is saved, using Django's messaging framework with Class Based Views, with code shown below, but don't show the message.</p>
  
  <p>Any help would be very much appreciated</p>
  
  <pre><code>#views.py
  
  from django.views.generic import ListView, CreateView, UpdateView, TemplateView
  from django.contrib.messages.views import SuccessMessageMixin
  
  class CreateEmployee(SuccessMessageMixin, CreateView):
      model = Employee
      template_name = 'employees/create.html'
      form_class = frmCreate
  
      def get_success_url(self):
         return reverse('Employees:Create')
  
      def get_context_data(self, **kwargs):
          contexto = super(CreateEmployee, self).get_context_data(**kwargs)
          contexto['action'] = reverse('Employees:Create')
          return contexto
  
      success_message = 'Employee successful created'
  
  
  
  #template
  #create.html
  
  &lt;form action="{{ action }}" method="POST" role="form"&gt;
      {% csrf_token %}
  
      {{ form.as_p }}
  
      &lt;input type="submit" value="Save" class="btn btn-success"&gt;
  &lt;form&gt;
  
  {% if messages %}
      &lt;div class="col-lg-3 color03"&gt;
          &lt;ul class="messages"&gt;
              {% for message in messages %}
                  &lt;li{% if message.tags %} class="{{ message.tags }}"{% endif %}&gt;{{ message }}&lt;/li&gt;
              {% endfor %}
          &lt;/ul&gt;
      &lt;/div&gt;
  {% endif %}
  </code></pre>