Search code examples
pythondjangonginxuwsgi

uWSGI NOT working with .ini file


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;
}

Solution

  • 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