Tôi đang cố gắng chạy một ứng dụng Django bằng uwsgi. Hầu hết các hướng dẫn tôi đã tìm thấy là "--wsgi-file" và "--module" để chỉ định ứng dụng, nhưng "uwsgi" không đề cập đến các tùy chọn này và khi tôi thử sử dụng chúng:tùy chọn uwsgi --wsgi-file và --module không được nhận dạng
uwsgi -s /tmp/uwsgi.sock --master --module myapp.wsgi
uwsgi: unrecognized option '--module'
getopt_long() error
Và
uwsgi -s /tmp/uwsgi.sock --master --wsgi-file myapp/wsgi.py
uwsgi: unrecognized option '--wsgi-file'
getopt_long() error
Khi tôi chạy nó mà không có một trong hai, tôi nhận được:
uwsgi -s /tmp/uwsgi.sock --master
*** Starting uWSGI 2.0.9 (64bit) on [Fri Jul 10 11:12:04 2015] ***
compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-11) on 23 April 2015 19:31:15
os: Linux-2.6.32-504.16.2.el6.x86_64 #1 SMP Tue Mar 10 17:01:00 EDT 2015
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
detected binary path: /usr/sbin/uwsgi
your processes number limit is 1024
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 UNIX address /tmp/uwsgi.sock fd 5
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145536 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 26597)
spawned uWSGI worker 1 (pid: 26598, cores: 1)
Tại sao không các tùy chọn này được công nhận? Tôi phải chỉ định ứng dụng để tải như thế nào? Đây là loại phần mềm rác nào? Tôi có nên quay lại sử dụng Gunicorn không?
Làm thế nào mà bạn cài đặt uwsgi? pip? – ThrowsException
@ aaa90210 Tôi thấy mình ở đây vì tôi có phản ứng buồn bã như bạn đã làm. Hầu hết các tùy chọn không hoạt động, mặc dù thấy vô số ví dụ trực tuyến. Cảm ơn bài đăng này. –