I'm trying to setup NGINX, uWSGI and Flask. I'm currently getting,
uWSGI Error
Python application not found
I get some strange errors in my uwsgi error file, which you can find at the bottom of my post.
I'll get straight to it, this is on a fresh VPS running Ubuntu 13.04 64bit, these are the commands I ran.
I then created a virtual environment, activated it and ran pip install flask I then made a folder called app and place a file called hello.py inside the same folder
/project
/app
-hello.py
/bin
/include
/lib
/local
This is my NGINX file (the nginx error file is empty)
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;
}
}
This is my uWSGI ini file
[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
This is my hello.py file
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_word():
return "Hello World!"
if __name__ == "__main__":
app.run()
This is my uWSGI error file https://p.kk7.me/sepukinulu.applescript 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.
Any help would be greatly appreciated!
You are requesting a 'run' module while your script is 'hello', infact:
ImportError: No module named run
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With