title: Django + uwsgi + ngnix + debug off = Server Error (500)
body: <p>I'm trying to set up a production server that consists of Django + uwsgi + Nginx.
  The tutorial I'm following is located here <a href="http://www.panta.info/blog/3/how-to-install-and-configure-nginx-uwsgi-and-django-on-ubuntu.html" rel="nofollow noreferrer">http://www.panta.info/blog/3/how-to-install-and-configure-nginx-uwsgi-and-django-on-ubuntu.html</a></p>
  <p>The production server is working because I can see the admin page when debug is on but when I turn to debug off. It displays the  Server Error (500) again. I don't know what to do. Ngnix should be serving the Django request. I'm clueless right now, Can someone kindly help me, please.</p>
  <p>my /etc/nginx/sites-available/mysite.com</p>
  <pre><code>server {
    listen  80;
    server_name mysite.com www.mysite.com;
    access_log /var/log/nginx/mysite.com_access.log;
    error_log /var/log/nginx/mysite.com_error.log;
  
  
    location / {
      uwsgi_pass  unix:///tmp/mysite.com.sock;
      include     uwsgi_params;
    }
  
  
  
    location /media/  {
      alias /home/projects/mysite/media/;
    }
  
  
  
    location  /static/ {
     alias  /home/projects/mysite/static/;
    }
  }
  </code></pre>
  <p>my /etc/uwsgi/apps-available/mysite.com.ini</p>
  <pre><code>[uwsgi]
  vhost = true
  plugins = python
  socket = /tmp/mysite.com.sock
  master = true
  enable-threads = true
  processes = 2
  wsgi-file = /home/projects/mysite/mysite/wsgi.py
  virtualenv = /home/projects/venv
  chdir = /home/projects/mysite
  touch-reload = /home/projects/mysite/reload
  </code></pre>
  <p>my settings.py</p>
  <pre><code>root@localhost:~# cat /home/projects/mysite/mysite/settings.py
  # Django settings for my site project.
  
  DEBUG = False
  TEMPLATE_DEBUG = DEBUG
  
  
  
  
  
  min/css/base.css&quot; failed (2: No such file or directory), client: 160.19.332.22, server: mysite.com, request: &quot;GET /static/admin/css/base.css HTTP/1.1&quot;, host: &quot;160.19.332.22&quot;
  2013/06/17 14:33:39 [error] 8346#0: *13 open() &quot;/home/projects/mysite/static/admin/css/login.css&quot; failed (2: No such file or directory), client: 160.19.332.22, server: mysite.com, request: &quot;GET /static/admin/css/login.css HTTP/1.1&quot;, host: &quot;174.200.14.200&quot;
  2013/06/17 14:33:39 [error] 8346#0: *14 open() &quot;/home/projects/mysite/static/admin/css/base.css&quot; failed (2: No such file or directory), client: 160.19.332.22, server: mysite.com, request: &quot;GET /static/admin/css/base.css HTTP/1.1&quot;, host: &quot;174.200.14.2007&quot;, referrer: &quot;http://174.200.14.200/admin/&quot;
  2013/06/17 14:33:39 [error] 8346#0: *15 open() &quot;/home/projects/mysite/static/admin/css/login.css&quot; failed (2: No such file or directory), client: 160.19.332.22, server: mysite.com, request: &quot;GET /static/admin/css/login.css HTTP/1.1&quot;, host: &quot;174.200.14.200&quot;, referrer: &quot;http://174.200.14.200/admin/&quot;
  </code></pre>