uWSGI + Flask + nginx + Digital Ocean:uwsgi [1359]:---找不到python应用程序
我的文件看起来像这样:
/projectfolder
/myapp
factory.py
config.py
__init__.py
wsgi.py
myapp.ini
factory.py:
def create_app():
app = Flask(__name__)
app.config.from_object(os.environ['APP_SETTINGS'])
return app
。__ INIT __ PY:
from myapp.factory import create_app
app = create_app()
wsgi.py:
from myapp import app as application
if __name__ == '__main__':
application.run()
MYAPP.INI
[uwsgi]
module = wsgi:application
master = true
processes = 5
socket = myapp.sock
chmod-socket = 660
vacuum = true
die-on-term = true
env = APP_SETTINGS=myapp.config.Config
我尝试运行uwsgi --socket 0.0.0.0:5000 --protocol=http -w wsgi:app
它似乎有用,但是使用nginx和uwsgi,我得到的只是no python application found
。我可以从中收集的是,不知何故,我的导入在wsgi.py中被破坏了。我只是不确定如何。