title: Default list of Django built-in middleware
body: <p>Django comes with a <a href="http://docs.djangoproject.com/en/dev/ref/middleware/" rel="nofollow noreferrer">list of built-in middleware</a>, but if one wants to use all (or most) of them, he has to work through tons of docs in order to get the right sorting in the settings.py file.</p>
  
  <p>Is there an optimal default order of <em>all</em> built-in Django 1.1 middleware classes? I.e., something to copy'n'paste into settings.py:</p>
  
  <pre><code>MIDDLEWARE_CLASSES = (
    # perfect order here please ;-)
  )
  </code></pre>
  
  <p>Alternative answer: Are there multiple possible orderings and what would be the difference?</p>
  
  <p>By the way: The order <em>is</em> significant, but I'm only aware of some of the default dependencies, like SessionMiddleware before AuthenticationMiddleware.</p>