Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/303.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 由于解释器模式,uWsgi服务器未正确运行_Python_Django_Nginx_Uwsgi - Fatal编程技术网

Python 由于解释器模式,uWsgi服务器未正确运行

Python 由于解释器模式,uWsgi服务器未正确运行,python,django,nginx,uwsgi,Python,Django,Nginx,Uwsgi,这是我第一次参加uWsgi——但经过数小时的配置,这并不是最顺利的过程 我正在用Nginx运行uWsgi(Nginx运行正常) 我正在尝试加载uwsgi: 1) uwsgi--socket 127.0.0.1:5000--chdir/path/to/my/django/application--wsgi文件django/application/wsgi.py--master--processs 4--threads 2 或 2) uwsgi--ini runserver.ini 结果是:两者都不

这是我第一次参加
uWsgi
——但经过数小时的配置,这并不是最顺利的过程

我正在用
Nginx
运行
uWsgi
Nginx
运行正常)

我正在尝试加载
uwsgi
: 1)
uwsgi--socket 127.0.0.1:5000--chdir/path/to/my/django/application--wsgi文件django/application/wsgi.py--master--processs 4--threads 2

2)
uwsgi--ini runserver.ini

结果是:两者都不能正确部署应用程序

当我运行第二个命令尝试时,我得到如下输出:

clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /my/django/application/directory
detected binary path: /usr/local/bin/uwsgi
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:5000 fd 3
Python version: 2.6.5 (r265:79063, Feb 27 2014, 19:56:00)  [GCC 4.4.3]
Python main interpreter initialized at 0x86ac688
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 357000 bytes (348 KB) for 8 cores
*** Operational MODE: preforking+threaded ***
failed to open python file hook_project/wsgi.py
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: 7477)
spawned uWSGI worker 1 (pid: 7478, cores: 2)
spawned uWSGI worker 2 (pid: 7479, cores: 2)
spawned uWSGI worker 3 (pid: 7480, cores: 2)
spawned uWSGI worker 4 (pid: 7481, cores: 2)
nginx配置

upstream django {
    # server unix:///path/to/your/mysite/mysite.sock; # for a file socket
    server xxx.xxx.xxx.xxx:8001; # for a web port socket (we'll use this first)
}

# configuration of the server
server {
    # the port your site will be served on
    listen      8003;
    # the domain name it will serve for
    server_name xxx.xxx.xxx.xxx; # substitute your machine's IP address or FQDN
    access_log /var/www/nginx_log/access.log;
    error_log /var/www/nginx_log/error.log;
    charset     utf-8;

    location /static {
        # the Django project's static files
        alias /path/to/django/static;
    }

    location / {
        uwsgi_pass  django;
        include     /etc/nginx/uwsgi_params; # or the uwsgi_params you installed manually
    }
    # max upload size
    client_max_body_size 75M;   # adjust to taste
}

有人能告诉我为什么我的应用程序根本没有加载,而uwsgi加载django应用程序失败吗?

请添加您的nginx配置。添加了它-请确定您看到了这一点,我认为您的问题与路径有关,所以请尝试更改wsgi.py并添加正确的路径。您的uwsgi配置很好。我也遇到了同样的问题,我通过将分支恢复到以前的提交来解决它,错误是因为一些未跟踪的文件