samedi 9 mai 2015

setup python+uWSGI: unable to load app

i'm following this Quickstart to set up an easy python uWSGI application.
My applicaiton is like:

def application(env, start_response):  
start_response('200 OK', [('Content-Type','text/html')])  
return ["Hello World"]

And i'm running uwsgi like:

uwsgi --http :9090 --wsgi-file test.py 

however, from the uwsgi output, it seems not successfully loaded the app:

* Starting uWSGI 2.0.10 (64bit) on [Sat May 9 10:43:42 2015]
compiled with version: 4.6.3 on 09 May 2015 10:02:20
os: Linux-3.13.0-49-generic #81~precise1-Ubuntu SMP Wed Mar 25 16:32:15 UTC 2015 nodename: XXX machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/YYY/proj/uwsgi-tutorial/mysite
detected binary path: /home/YYY/proj/uwsgi-tutorial/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
WARNING: you are running uWSGI without its master process manager
your processes number limit is 13261
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :9090 fd 4
spawned uWSGI http 1 (pid: 7713)
uwsgi socket 0 bound to TCP address 127.0.0.1:47552 (port auto-assigned) fd 3
Python version: 2.7.3 (default, Dec 18 2014, 19:25:50) [GCC 4.6.3]
Python threads support is disabled. You can enable it with --enable-threads
Python main interpreter initialized at 0xed4cc0
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72768 bytes (71 KB) for 1 cores
Operational MODE: single process
failed to open python file tests.py
unable to load app 0 (mountpoint='') (callable not found or import error)
no app loaded. going in full dynamic mode
uWSGI is running in multiple interpreter mode *
spawned uWSGI worker 1 (and the only) (pid: 7712, cores: 1)

and when i try to access the page from browser, it failed with message "This webpage is not available"

Any idea why uWSGI failed to load the test.py application?
And i'm running all this on ubuntu-12.04 in a fresh Azure VM

Aucun commentaire:

Enregistrer un commentaire