title: TemplateView in Django with custom status code
body: <p>I have internal account privacy permissions in my project(e.g. only friends can see profile page of user) and I want to have custom permission denied page for this case. Is there any way to return response from TemplateView with status code equals 403?</p>
  
  <p>Something like this:</p>
  
  <pre><code>class PrivacyDeniedView(TempateView):
      template_name = '...'
      status_code = 403
  </code></pre>
  
  <p>I can do this by override dispatch() but maybe Django has out of the box solution</p>
  
  <p>Answer: it looks like there no generic solution. The best way is proposed by @alecxe, but encapsulated in Mixin as @FoxMaSk proposed</p>