Testing my Django app with uWSGI

3.3k views Asked by At

I have written a uWSGI config file for my application that I'm trying to deploy on a production env.

myapp_wsgi.ini:

[uwsgi]

uid = www-data
gid = www-data

userhome = /home/glide
chdir = %(userhome)/myapp
module = myapp.wsgi
virtualenv = %(userhome)/.virtualenvs/myapp
env = DJANGO_SETTINGS_MODULE=myapp.settings

master = true
processes = 4
socket = /tmp/%n.sock
buffer-size = 32768
req-logger = file:/var/log/uwsgi/access.log
logger = file:/var/log/uwsgi/error.log
touch-reload = .git/index
enable-threads = true

As I'm not able to make it work beside my vassals (emperor mode I don't even see it loaded in the log, even by sending SIGHUP to the emperor process) I'm trying to check my configuration directly with uwsgi:

$ uwsgi myapp_uwsgi.ini
[uWSGI] getting INI configuration from myapp_uwsgi.ini

But it simply hangs there with no more message, nothing is appended to the error log.

I'm sure it's an expected behavior and I'm not looking in the right direction but I didn't have the courage to read the entire uWSGI doc which is quite generous.

So the question is how can I check my configuration ?


On the other hand, I also configured a vhost with NginX which logs me

*82 connect() to unix:///tmp/myapp.sock failed (111: Connection refused) while connecting to upstream, client: xxx.xxx.xxx.xxx, server: myapp.myhost.eu, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:///tmp/myapp.sock:", host: "myapp.myhost.eu"

when I'm soliciting it

1

There are 1 answers

0
Pierre de LESPINAY On BEST ANSWER

I had several things badly configured primarily the socket permission and some other small things.

That's why my Nginx was not able to talk to uWGSI.

This really good uWSGI howto Django & NginX helped me a lot to make work.