title: How to clean up Django login message from framework
body: <p>There is a project setup with <strong>Django 1.6</strong> and <strong>Django allauth</strong>. when user logged in django saves a login message to users session and its stack in there. While user reached to any page included messages framework, login message shows up with other message.</p>
  
  <p>Because of this reason, <strong>I want to remove login message from message queue after user logged in.</strong></p>
  
  <p>I tried remove login message in <em>django</em>'s and <em>allauth</em>'s <code>user_logged_in</code> <em>signal</em>, but I discovered the message is not created there.</p>
  
  <p>The example of the message removal code is below:</p>
  
  <pre><code># from allauth.account.signals import user_logged_in
  # First I tried allauth signal above.
  from django.contrib.auth.signals import user_logged_in
  
  @receiver(user_logged_in)
  def user_logged_in_(request, **kwargs):
      storage = messages.get_messages(request)
      storage.used = True
  </code></pre>
  
  <p><strong>Edit:</strong> The workaround below is working. But I feel it is not right way to do.</p>
  
  <p><s>After this, I decided to make a workaround. After user logged in, user redirected to index view. I removed signal and append <code>storage.used = True</code> method in <em>index view</em>. Also It is not worked too.</p>
  
  <pre><code>def clear_messages(request):
      storage = messages.get_messages(request)
      storage.used = True
  
  
  def index(request):
      clear_messages(request)
      return render_to_response('website/index.html', {}, context_instance=RequestContext(request, {}))
  </code></pre>
  
  <p></s></p>