通过Nginx服务烧瓶的问题

时间:2014-06-08 05:48:07

标签: python nginx flask webserver

我无法通过nginx提供烧瓶。我仔细查看了日志,然后说:

Traceback (most recent call last):
  File "/var/www/site.me/server.py", line 1, in <module>
    from flask import Flask
ImportError: No module named flask
Sun Jun  8 09:35:30 2014 - unable to load app 0 (mountpoint='') (callable not found or import error)
Sun Jun  8 09:35:30 2014 - *** no app loaded. going in full dynamic mode ***
Sun Jun  8 09:35:30 2014 - *** uWSGI is running in multiple interpreter mode ***
Sun Jun  8 09:35:30 2014 - spawned uWSGI master process (pid: 2176)
Sun Jun  8 09:35:30 2014 - spawned uWSGI worker 1 (pid: 2180, cores: 1)
Sun Jun  8 09:35:30 2014 - spawned uWSGI worker 2 (pid: 2181, cores: 1)

然而,在虚拟环境中,我确保安装了烧瓶。 这是我的nginx配置文件。

server {
    listen 80;
    root /var/www/site;

    index index.html index.htm;
    error_log /root/Documents/site;
    rewrite_log on;
    server_name www.site.me;

    location / {
        include uwsgi_params;
        uwsgi_pass unix:/tmp/site.sock;
        uwsgi_param UWSGI_CHDIR /var/www/site/env;
        uwsgi_param UWSGI_PYHOME /var/www/site/env;
        uwsgi_param UWSGI_MODULE server;
        uwsgi_param UWSGI_CALLABLE app;
    }
}

这是我对uwsgi的配置。

[uwsgi]
vhost = true
socket = /tmp/site.sock
venv = /var/www/site.sock/.env
chdir = /var/www/site.me/
module = server
callable = app
no-site= true

我将非常感谢任何帮助。

0 个答案:

没有答案