Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

configuring nginx and uwsgi for python flask application

Tags:

python

uwsgi

am trying to configure uwsgi and in the process it says on a tutorial that I must run

uwsgi -s /tmp/uwsgi.sock -w myapp:app

the problem is -w is an invalid option. Can anyone help me point out why or what should I do?

Thanks

like image 484
Mo J. Mughrabi Avatar asked Jun 23 '12 19:06

Mo J. Mughrabi


2 Answers

maybe you are using debian-supplied packages. They are fully modular so you need to install/load the required plugins:

http://projects.unbit.it/uwsgi/wiki/Quickstart

like image 111
roberto Avatar answered Nov 09 '22 20:11

roberto


My uwsgi app configuration looks like that

/etc/uwsgi/apps-enabled/mysite.ini

[uwsgi]
socket=/tmp/uwsgi_mysite.sock
chmod-socket=666
abstract-socket=false

master=true
workers=2

uid=altera
gid=altera

chdir=/home/altera/www/mysite   ; Current dir
pp=/home/altera/www/mysite      ; Python Path (to your application)
pyhome=/home/altera/vpy/mysite  ; Path to virtual environment
plugins=python3  
module=main                     ; *.py file name application starting from 

post-buffering=8192

/etc/nginx/sites-available/mysite

    server {
        server_name     mysite;

        root /home/altera/www/mysite;

        location / {
                include        uwsgi_params;
                uwsgi_pass     unix:/tmp/uwsgi_mysite.sock;
        }
}
like image 2
atomAltera Avatar answered Nov 09 '22 22:11

atomAltera