15

私の uwsgi 設定には、次のオプションがあります。

[uwsgi]
chmod-socket = 777
socket = 127.0.0.1:9031
plugins = python
pythonpath = /adminserver/
callable = app
master = True
processes = 4
reload-mercy = 8
cpu-affinity = 1
max-requests = 2000
limit-as = 512
reload-on-as = 256
reload-on-rss = 192
no-orphans
vacuum

私のアプリの構造は次のようになります。

/adminserver
   app.py
   ...

app.pyにはこれらのコードがあります:

app = Flask(__name__)
...

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5003, debug=True)

その結果、サーバーをカールしようとすると、次のエラーが発生します。

Wed Sep 11 23:28:56 2013 - added /adminserver/ to pythonpath.
Wed Sep 11 23:28:56 2013 - *** no app loaded. going in full dynamic mode ***
Wed Sep 11 23:28:56 2013 - *** uWSGI is running in multiple interpreter mode ***

moduleとオプションは何をしcallableますか? ドキュメントは言う:

モジュール、wsgi引数: 文字列

WSGI モジュールをアプリケーションとしてロードします。モジュール (sans .py) はインポート可能でなければなりません。PYTHONPATH にあります。

このオプションは、コマンド ラインから -w で設定できます。

callable引数: 文字列 デフォルト: アプリケーション

デフォルトの WSGI 呼び出し可能名を設定します。

4

3 に答える 3