title: Send Custom message in Django PermissionDenied
body: <p>I am using django's <code>PermissionDenied</code> to render <code>403.html</code> whenever the user is not allowed to access any page. </p>
  
  <p>There are whole lot of pages, of different type, for example, <code>Product page</code>, <code>User Page</code>, <code>User Contact information</code>, <code>Owner Information</code>.</p>
  
  <p>I would like to add the custom message with <code>PermissionDenied</code>, that would tell the user exactly why he can not view this page. I would like to add the following dynamic message to the <code>403.html</code>.</p>
  
  <pre><code>You have are trying to `View a Product (id:3094384)` while having a `Trail` account. You are not authorized to view this product. 
  </code></pre>
  
  <p>And</p>
  
  <pre><code> You have are trying to `View a Customer (id:48)` which is Private. You are not authorized to view this User. 
  </code></pre>
  
  <p>and so on. </p>
  
  <h2>here is my code</h2>
  
  <pre><code>elif role.id == Project.ROLE_SALES and not project.sales_person_id == user_id:
              raise PermissionDenied
  </code></pre>
  
  <h2>html</h2>
  
  <pre><code>&lt;body class="error-page"&gt;
  
  &lt;!--  content --&gt;
  &lt;section&gt;
      &lt;div class="error403"&gt;
          &lt;h1&gt;403&lt;/h1&gt;
      &lt;/div&gt;
      &lt;p class="description"&gt;Oops! Request forbidden...&lt;/p&gt;
  
      &lt;p&gt;Sorry, it appears the page you were looking for is forbidden and not accessible. If the problem persists, please
          contact web Administrator.&lt;/p&gt;
  
  
  # HERE I WANT TO SHOW DYNAMIC MESSAGE. 
  
  
  
      &lt;a href="{{ request.META.HTTP_REFERER }}" class="btn btn-danger403 btn-primary btn-large" &gt;
          Go Back &lt;/a&gt;
  {{ except }}
  &lt;/section&gt;
  
  
  
  &lt;script src="{% static 'js/jquery.min.js' %}"&gt;&lt;/script&gt;
  &lt;script src="{% static 'js/bootstrap.js' %}"&gt;&lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <h2>Possibility</h2>
  
  <pre><code>raise PermissionDenied("Custom message")
  </code></pre>
  
  <h2>Or</h2>
  
  <p>Pass a context to <code>PermissionDenied</code>?</p>
  
  <p>Suggestions. </p>