title: pyramid view for 503 subclass
body: <p>I'd like to serve some templated html along with a 503 status code when I hit a particular case in my app. Subclassing the pyramid 503 exception represents this handily:</p>
  
  <pre><code>from pyramid.httpexceptions import HTTPServiceUnavailable
  class PleaseWait(HTTPServiceUnavailable):
      pass
  
  def business_logic():
      if not_ready():
          raise PleaseWait()
  </code></pre>
  
  <p>What I can't figure out is a clean way to hook up a template to <code>PleaseWait</code>. This nearly works, but gives code 200:</p>
  
  <pre><code>config.add_view(
      renderer='templates/please_wait.jinja2',
      context='my_app.PleaseWait',
  )
  </code></pre>
  
  <p>This completely works, but seems messy:</p>
  
  <pre><code>@view_config(context=PleaseWait, renderer='templates/please_wait.jinja2')
  def please_wait(exc, request):
      request.response.status = 503
      return {}
  </code></pre>
  
  <hr>
  
  <p>This also works, but seems maybe bizarre: <code>request.response = exc</code>.</p>