简体   繁体   中英

uWSGI module found when invoked on the command line but not when invoked using emperor

I have a python wsgi application which I am running under uWSGI.

When I try to run the same application using emperor I get an error -

ImportError: No module named app_thing
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***

If I run uWSGI directly specifying the same config file that emperor is using it finds the module and the application works.

uWSGI config file below.

[uwsgi]
socket = 127.0.0.1:8000
workers = 1
force-cwd = /home/user/py
module = app_thing:application
protocol = http

Any help appreciated...

Ok, turns out the fix involved setting the file rather than the module and also adding the dir to the python path in the uWSGI config. Final config ended up as

    [uwsgi]
    socket = 127.0.0.1:8000
    workers = 1
    force-cwd = /home/py
    file = /home/py/app_thing.py
    pythonpath = /home/py

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM