title: Passing a cause description to a 403 handler view
body: <p>I want to show an informative error message to a user hitting a page that results in a 403 Forbidden. I'm using Django 1.8.</p>
  
  <p>My idea of passing an error message is this:</p>
  
  <pre><code># in a view
  if not ...:
    raise PermissionDenied('You have no power here')
  </code></pre>
  
  <p>Then somewhere in the <code>handler403</code> view, I'd like to retrieve the message (or maybe even a structured object) and render an informative page based on it.</p>
  
  <p>Though the handler seems to only receive the request object and the template name.</p>
  
  <p>Is there a way to pass a custom message to the handler? (Of course I could assign a custom attribute to the request object before raising the exception, and hope that the same object will be passed to the handler, but this feels like a hack.)</p>
  
  <p><strong>Update:</strong> Indeed there is a middleware for that already: <a href="https://docs.djangoproject.com/en/1.8/ref/contrib/messages/" rel="nofollow"><code>contrib/messages</code></a> is capable of piggybacking messages on the request object, and more.</p>