未找到带有UWSGI:Python应用程序的烧瓶

未找到带有UWSGI:Python应用程序的烧瓶,python,nginx,flask,uwsgi,linode,Python,Nginx,Flask,Uwsgi,Linode,我遵循了设置UWSGI with Flask应用程序的步骤,在我尝试放置我的应用程序(而不是示例应用程序)之前,一切似乎都正常,当我得到“UWSGI Error Python application not found”(未找到UWSGI Error Python application)时 /srv/www/xxx.com/xxx/中我的文件结构如下: app/ __init__.py uwsgi.py \uuuu init\uuuuu.py文件中有一行用于运行应用程序: if __

我遵循了设置UWSGI with Flask应用程序的步骤,在我尝试放置我的应用程序(而不是示例应用程序)之前,一切似乎都正常,当我得到“UWSGI Error Python application not found”(未找到UWSGI Error Python application)时

/srv/www/xxx.com/xxx/
中我的文件结构如下:

app/
    __init__.py
uwsgi.py
\uuuu init\uuuuu.py
文件中有一行用于运行应用程序:

if __name__ == '__main__':
    app.run()
并且
uwsgi.py
导入应用程序:

#!flask/bin/python

from app import app

if __name__ == "__main__":
    app.run(debug = False)
当我手动尝试运行
python uwsgi.py
时,该应用程序似乎可以工作,因此没有错误或错误的导入。如果我将
uwsgi.py
的内容更改为类似的内容(来自示例):

应用程序似乎正在运行,因此UWSGI和nginx工作正常,并运行
UWSGI.py
文件,但当我将其指向我的应用程序时,情况并非如此

我的uwsgi配置:

<uwsgi>
    <plugin>python</plugin>
    <socket>/run/uwsgi/app/xxx.com/xxx.com.socket</socket>
    <pythonpath>/srv/www/xxx.com/application/xxx/</pythonpath>
    <app mountpoint="/">

        <script>uwsgi</script>

    </app>
    <master/>
    <processes>4</processes>
    <harakiri>60</harakiri>
    <reload-mercy>8</reload-mercy>
    <cpu-affinity>1</cpu-affinity>
    <stats>/tmp/stats.socket</stats>
    <max-requests>2000</max-requests>
    <limit-as>512</limit-as>
    <reload-on-as>256</reload-on-as>
    <reload-on-rss>192</reload-on-rss>
    <no-orphans/>
    <vacuum/>
</uwsgi>
这是uwsgi错误日志:

added /srv/www/xxx.com/application/xxx/ to pythonpath.
- 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 master process (pid: 21982)
- spawned uWSGI worker 1 (pid: 21990, cores: 1)
- set cpu affinity for worker 1 toTue Sep 23 16:51:19 2014 -  0Tue Sep 23 16:51:19 2014 -
- spawned uWSGI worker 2 (pid: 21991, cores: 1)
- *** Stats server enabled on /tmp/stats.socket fd: 14 ***
- set cpu affinity for worker 2 toTue Sep 23 16:51:19 2014 -  0Tue Sep 23 16:51:19 2014 -

谁能告诉我哪里出了错?我花了几个小时尝试各种解决方案,但似乎都不起作用,我一定是遗漏了一些重要的东西,但找不到它。

尝试添加
应用程序

仍然一样。尝试了
应用程序
应用程序
以防万一。哇,我成功地做到了,我添加了
应用程序
以及
应用程序
,效果很好。有人知道这是什么原因吗?为什么必须这样定义?uWSGI寻找一个名为
的可调用应用程序
。如果你叫它别的名字,它需要知道名字是什么。
server {
        listen          80;
        server_name     $hostname;
        access_log /srv/www/xxx.com/logs/access.log;
        error_log /srv/www/xxx.com/logs/error.log;

        location / {
            uwsgi_pass      unix:///run/uwsgi/app/xxx.com/xxx.com.socket;
            include         uwsgi_params;
            uwsgi_param     UWSGI_SCHEME $scheme;
            uwsgi_param     SERVER_SOFTWARE    nginx/$nginx_version;

        }

        location /static {
            root   /srv/www/xxx.com/public_html/static/;
            index  index.html index.htm;

        }

}
added /srv/www/xxx.com/application/xxx/ to pythonpath.
- 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 master process (pid: 21982)
- spawned uWSGI worker 1 (pid: 21990, cores: 1)
- set cpu affinity for worker 1 toTue Sep 23 16:51:19 2014 -  0Tue Sep 23 16:51:19 2014 -
- spawned uWSGI worker 2 (pid: 21991, cores: 1)
- *** Stats server enabled on /tmp/stats.socket fd: 14 ***
- set cpu affinity for worker 2 toTue Sep 23 16:51:19 2014 -  0Tue Sep 23 16:51:19 2014 -