title: Internal Server Error: Django, uWsgi, Nginx, Pyenv
body: <p>I am trying to serve a Django application using Nginx and uWsgi</p>
  
  <p>I followed </p>
  
  <p><a href="https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-14-04" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-14-04</a></p>
  
  <p><a href="https://serverfault.com/questions/775965/wiring-uwsgi-to-work-with-django-and-nginx-on-ubuntu-16-04">https://serverfault.com/questions/775965/wiring-uwsgi-to-work-with-django-and-nginx-on-ubuntu-16-04</a></p>
  
  <p>for same.</p>
  
  <p>platforms.ini file</p>
  
  <pre><code>[uwsgi]
  project = platforms
  base = /home/ubuntu
  
  chdir = /home/ubuntu/platforms/
  home = /home/ubuntu/.local/share/virtualenvs/platforms-hQBv-BwK/
  module = platforms.wsgi:application
  
  master = true
  processes = 5
  logger = file:/home/ubuntu/platforms/logs/uwsgi.log
  
  socket = %(base)/%(project)/%(project).sock
  chmod-socket = 666
  </code></pre>
  
  <p>uwsgi.service file</p>
  
  <pre><code>[Unit]
  Description=uWSGI Emperor service
  After=syslog.target
  
  [Service]
  ExecStart=/home/ubuntu/.pyenv/versions/3.7.6/bin/uwsgi --emperor /etc/uwsgi/sites
  Restart=always
  KillSignal=SIGQUIT
  Type=notify
  StandardError=syslog
  NotifyAccess=all
  
  [Install]
  WantedBy=multi-user.target
  vacuum = true
  </code></pre>
  
  <p>When I run the application using below command</p>
  
  <pre><code>uwsgi --http :8000 --home /home/ubuntu/.local/share/virtualenvs/platforms-hQBv-BwK --chdir /home/ubuntu/platforms -w platforms.wsgi
  </code></pre>
  
  <p>it works fine.</p>
  
  <pre><code>python manage.py runserver 0.0.0.0:8000
  </code></pre>
  
  <p>works fine</p>
  
  <p>But when i run using ini file </p>
  
  <p>I get </p>
  
  <pre><code>internal server error
  </code></pre>
  
  <p>also in the logs i am getting </p>
  
  <pre><code>--- no python application found, check your startup logs for errors ---
  [pid: 6752|app: -1|req: -1/7] xx.xxx.xxx.xx () {44 vars in 904 bytes} [Wed Mar 11 07:12:50 2020] GET /admin/ =&gt; generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
  announcing my loyalty to the Emperor...
  </code></pre>
  
  <p>I am unable to figure out what could be issue. Please Help.</p>