uwsgi startet und funktioniert von der Konsole aus, möchte aber nicht mit der Konfigurationsdatei

uwsgi startet und funktioniert von der Konsole aus, möchte aber nicht mit der Konfigurationsdatei

Ich habe ein Problem mit uwsgi. Wenn ich uwsgi von der Konsole aus starte:

 uwsgi --socket 127.0.0.1:5555  --chdir /var/www/proj/smth/ --wsgi-file /var/www/.../rest_api/wsgi.py &

Es zeigt Webseiten an und alles sieht gut aus. Aber wenn ich eine uwsgi-Konfigurationsdatei mit so etwas verwende:

[uwsgi]
chdir = /var/www/proj
socket = :5555
wsgi-file = /var/www/proj/rest/rest_api/wsgi.py 
home = /var/www/proj
processes = 4
threads = 2
touch-reload=/var/www/proj/rest/rest_api/wsgi.py
daemonize=/var/log/uwsgi/rest.log
vacuum=true
; wtf we get errors w-out this and it won't start: 
no-site=true

In meinem Webbrowser wird ein interner Serverfehler angezeigt. Ich verwende nginx.

Und einige meiner uwsgi-Protokollzeilen sehen so aus:

ImportError: No module named ...
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 ***
--- no python application found, check your startup logs for errors ---

Antwort1

die Einstellung

chdir = /var/www/proj

sieht nicht gleich aus, wenn Sie es in der Befehlszeile ausführen

--chdir /var/www/proj/smth/ 

Ist das richtig oder liegt es nur daran, dass Sie das Einfügen bearbeitet haben?

Antwort2

Ich habe die Lösung gefunden. Ich habe einige Zeilen in uwsgi.ini gelöscht und nur diese übrig gelassen:

chdir = /var/www/proj/rest/
socket = 127.0.0.1:xxxx
wsgi-file = /var/www/proj/rest/rest_api/wsgi.py 
daemonize=/var/log/uwsgi/rest.log

Jetzt funktioniert es.

verwandte Informationen