title: Deleting/Clearing django.contrib.messages
body: <p>I want to conditionally clear <code>django.contrib.messages</code>. None of the solutions discussed in these two questions work:  </p>
  
  <p><a href="https://stackoverflow.com/questions/39518310/delete-all-django-contrib-messages">Delete all django.contrib.messages</a><br>
  <a href="https://stackoverflow.com/questions/4083164/django-remove-message-before-they-are-displayed">Django: Remove message before they are displayed</a> </p>
  
  <p>Any suggestions on how I can clear the messages? I am using django 1.10 </p>
  
  <p>Code:</p>
  
  <pre><code>messages = get_messages(request)
  for msg in messages:
      pass
  for msg in messages._loaded:
      del msg
  for msg in messages._queued_messages:
      del msg
  </code></pre>