cat /etc/nginx/sites-available/mywebsite
server {
listen 80;
server_name mywebsite;
location /static {
alias /var/www/mywebsite/static;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/tmp/website.sock;
uwsgi_param UWSGI_PYHOME /var/www/mywebsite/env;
uwsgi_param UWSGI_CHDIR /var/www/mywebsite;
uwsgi_param UWSGI_MODULE mywebsite;
uwsgi_param UWSGI_CALLABLE mywebsite;
}
error_page 404 /404.html;
}
cat /etc/uwsgi/apps-available/website.ini
[uwsgi]
plugins=python
vhost=true
socket=/tmp/website.sock
cat /var/www/mywebsite/mywebsite.py
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
return "It works!"
if __name__ == "__main__":
app.run()
I'm running nginx, then uwsgi and has uWSGI Error 'Python application not found' in browser.
I had the same error, in the same configuration, and my problem was simply that the uwsgi service wasn't started. Restarting both nginx and uwsgi solved the problem.
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