title: Flask, Nginx, uWSGI Python Application not found
body: <p>I'm trying to setup NGINX, uWSGI and Flask. I'm currently getting, </p>
  
  <hr>
  
  <p><strong>uWSGI Error</strong></p>
  
  <p>Python application not found</p>
  
  <hr>
  
  <p>I get some strange errors in my uwsgi error file, which you can find at the bottom of my post.</p>
  
  <p>I'll get straight to it, this is on a fresh VPS running Ubuntu 13.04 64bit, these are the commands I ran.</p>
  
  <ul>
  <li>sudo apt-get update</li>
  <li>sudo apt-get install build-essential</li>
  <li>sudo apt-get install python-dev</li>
  <li>sudo apt-get install python-pip</li>
  <li>sudo apt-get install nginx</li>
  <li>sudo apt-get install uwsgi</li>
  <li>sudo apt-get install uwsgi-plugin-python</li>
  <li>sudo pip install virtualenv</li>
  </ul>
  
  <p>I then created a virtual environment, activated it and ran <strong>pip install flask</strong> I then made a folder called app and place a file called hello.py inside the same folder</p>
  
  <pre><code>/project
      /app
          -hello.py
      /bin
      /include
      /lib
      /local
  </code></pre>
  
  <p>This is my NGINX file (the nginx error file is empty)</p>
  
  <pre><code>server {
      listen 80;
  
      server_name project.domain.net;
  
      location / {
          try_files $uri @app;
      }
  
      location @app {
          include uwsgi_params;
          uwsgi_pass unix:/tmp/uwsgi.sock;
      }
  
      location ~ /\. {
          deny all;
      }
  }
  </code></pre>
  
  <p>This is my uWSGI ini file</p>
  
  <pre><code>[uwsgi]
  chdir = /home/user/projects/python/flask/project
  uid = www-data
  gid = www-data
  chmod-socket = 666
  plugin = python
  socket = /tmp/uwsgi.sock
  module = run
  callable = app
  virtualenv = /home/user/projects/python/flask/project
  </code></pre>
  
  <p>This is my hello.py file</p>
  
  <pre><code>from flask import Flask
  app = Flask(__name__)
  
  @app.route("/")
  def hello_word():
      return "Hello World!"
  
  if __name__ == "__main__":
      app.run()
  </code></pre>
  
  <p>This is my uWSGI error file <a href="https://p.kk7.me/sepukinulu.applescript">https://p.kk7.me/sepukinulu.applescript</a> it's quite long so I figured I would paste it in a pastebin-style website. I can edit my post to include it here if this is not ok.</p>
  
  <p>Any help would be greatly appreciated!</p>