title: Proper way to handle error in django
body: <p>Hi everyone
  I just realized that on deployment, debug = False, doing something like this: </p>
  
  <pre><code>    try:
          fb_friends_raw = retrieve_and_store_fb_friends(request.facebook.uid, request.facebook.access_token)
      except Exception, e: 
          messages.error( request, 'Cannot retrieve your friends, do it later.' + str(e))
          return HttpResponseServerError('Cannot retrieve your friends, do it later.' + str(e))
  </code></pre>
  
  <p>will bring you to just a plain html file with the error as the main body rather than 500.html. I don't think that 404 is suitable because it is a server error rather than a page not found.</p>
  
  <p>Obviously when the user encounters this problem, I want to render the base template which has a logout button where the user can start from scratch. I 
  currently have that in 500.html and 404.html.</p>
  
  <p>What is the proper way to deal with errors on deployment?</p>