librelist archives

« back to archive

uwsgi error with 'no python application found'

uwsgi error with 'no python application found'

From:
Ankun Lee
Date:
2013-04-18 @ 09:42
start uwsgi:

uwsgi -s /tmp/uwsgi.sock -M -p 4 -t 30 --limit-as 128 -R 10000 -d
/var/log/uwsgi.log --vhost --uid www --gid www --python-autoreload 1



nginx.conf:

server {
    listen       80;
    server_name  xxxx.com/

    location /static {
            alias /home/wwwroot/xxxx/static;
    }
    location / {
            include uwsgi_params;
            uwsgi_pass  unix:/tmp/uwsgi.sock;
            uwsgi_param UWSGI_PYHOME   /home/ENV/;
            uwsgi_param UWSGI_CHDIR    /home/wwwroot/xxxx;
            uwsgi_param UWSGI_SCRIPT   xxxx;
            uwsgi_param UWSGI_CALLABLE app;
    }
}



xxxx.py:

from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()


error log:

*** Starting uWSGI 1.9.6 (32bit) on [Thu Apr 18 16:40:47 2013] ***
compiled with version: 4.4.7 on 18 April 2013 15:12:56
......
Python auto-reloader enabled
unable to load app 0 (mountpoint='xxxx.com|') (callable not found or import
error)
--- no python application found, check your startup logs for errors ---
xxxx.com [pid: 2009|app: -1|req: -1/1] 101.80.87.xxx () {44 vars in 723
bytes} [Thu Apr 18 16:40:53 2013] GET / => generated 21 bytes in 107 msecs
(HTTP/1.1 500) 1 headers in 57 bytes (0 switches on core 0)
unable to load app 0 (mountpoint='xxxx.com|') (callable not found or import
error)

and I used virtualenv to install flask. Any problems here?

Re: [flask] uwsgi error with 'no python application found'

From:
David Van Duzer
Date:
2013-04-18 @ 13:50
Try passing -H <virtualenv name> to uwsgi.

On Apr 18, 2013, at 3:42, Ankun Lee <cnrootkit@gmail.com> wrote:

> start uwsgi:
> 
> uwsgi -s /tmp/uwsgi.sock -M -p 4 -t 30 --limit-as 128 -R 10000 -d 
/var/log/uwsgi.log --vhost --uid www --gid www --python-autoreload 1
> 
> 
> 
> nginx.conf:
> 
> server {
>     listen       80;
>     server_name  xxxx.com/
> 
>     location /static {
>             alias /home/wwwroot/xxxx/static;
>     }
>     location / {
>             include uwsgi_params;
>             uwsgi_pass  unix:/tmp/uwsgi.sock;
>             uwsgi_param UWSGI_PYHOME   /home/ENV/;
>             uwsgi_param UWSGI_CHDIR    /home/wwwroot/xxxx;
>             uwsgi_param UWSGI_SCRIPT   xxxx;
>             uwsgi_param UWSGI_CALLABLE app;
>     }
> }
> 
> 
> 
> xxxx.py:
> 
> from flask import Flask
> app = Flask(__name__)
> 
> @app.route("/")
> def hello():
>     return "Hello World!"
> 
> if __name__ == "__main__":
>     app.run()
> 
> 
> error log:
> 
> *** Starting uWSGI 1.9.6 (32bit) on [Thu Apr 18 16:40:47 2013] ***
> compiled with version: 4.4.7 on 18 April 2013 15:12:56
> ......
> Python auto-reloader enabled
> unable to load app 0 (mountpoint='xxxx.com|') (callable not found or 
import error)
> --- no python application found, check your startup logs for errors ---
> xxxx.com [pid: 2009|app: -1|req: -1/1] 101.80.87.xxx () {44 vars in 723 
bytes} [Thu Apr 18 16:40:53 2013] GET / => generated 21 bytes in 107 msecs
(HTTP/1.1 500) 1 headers in 57 bytes (0 switches on core 0)
> unable to load app 0 (mountpoint='xxxx.com|') (callable not found or 
import error)
> 
> and I used virtualenv to install flask. Any problems here?