title: Django in production: set DEBUG = False causes `Server Error (500)`
body: <p>I know this question <a href="https://stackoverflow.com/questions/15128135/setting-debug-false-causes-500-error">has been discussed</a>. But the problem persists, and I am left without any solution. Please help.</p>
  
  <p>My platform is: Ubuntu 14.04 LTS, Python 3.4, MySQL 5.5, Django 1.7, Nginx 1.4.6, and Gunicorn 19.1.1.</p>
  
  <p>When I set <code>DEBUG = False</code> in the production server, my Django application runs OK for maybe half a day. And after that, the annoying <code>Server Error (500)</code> always appear for certain functions, but not every one. If I turn <code>DEBUG = True</code>, everything will be fine.</p>
  
  <p>I also set <code>ALLOWED_HOSTS = ['*']</code>. Some said that it should not be a wild card in production. But my app is for public, how should I set it? Others said that it should be <code>'localhost'</code>. But only <code>localhost</code> can access the server? Why go production, then?</p>
  
  <p>Is there a standard solution to this problem? Thanks.</p>