uWSGI NOT working with .ini file but works directly from command line.
For this project, I'm using Python
with Django
, NGinX
and uWSGI
.
When running the server configuration with parameters directly in the command line, it works but does not work when using the .ini file.
In my NGinX
configuration, I have this uwsgi_pass command:
uwsgi --socket ifbAMPdatabase/ifbAMPdatabase.sock --module ifbAMPdatabase.wsgi --chmod-socket=666
.ini file:
[uwsgi]
project = ifbAMPdatabase
base = /home/ampdbvenv/ifbAMPdb
home = %(base)/pyVenvIFBAMPDB/
chdir = %(base)/%(project)/
#module = %(base)/%(project).wsgi
module = %(project).wsgi:application
wsgi-file = %(base)/%(project)/wsgi.py
master = true
processes = 4
socket = %(base)/%(project)/%(project).sock
chmod-socket = 666
vacuum = true
; plugins=python
enable-threads = true
uid = www-data
gid = www-data
log-date = true
OBS:
Some of these parameters I have added just for testing, but they didn't change a thing (it wasn't working with a simple .ini file like in the documentaton).
nginx site file:
location / {
uwsgi_pass django;
include /etc/nginx/uwsgi_params;
}
. INI files are a de facto standard configuration format used by many applications. It consists of [section] s and key=value pairs. An example uWSGI INI configuration: [uwsgi] socket = /tmp/uwsgi.sock socket = 127.0.0.1:8000 workers = 3 master = true.
That's the simple answer, anyway -- you don't need it. uWSGI is itself a capable server.
Both can reach very impressive levels of performance, though some have mentioned that Gunicorn works better under high load. Drawbacks to Gunicorn are much the same as uWSGI, though I personally have found Gunicorn to be more easily configurable than uWSGI.
Check the status of the uwsgi process to find out whether it was able to start: sudo systemctl status uwsgi.
In my project, uwsgi run in docker container
socket = :8000
not work
but, change to
http-socket = :8000
it work
hope that will be helpful
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With