title: How do I return a 401 Unauthorized in Django?
body: <p>Instead of doing this:</p>
  
  <pre><code>res = HttpResponse("Unauthorized")
  res.status_code = 401
  return res
  </code></pre>
  
  <p>Is there a way to do it without typing it every time?</p>