Hi.

So before actually sending the email I search and I tried tons of
different configs to try to make this work but I got to a point that I
got confused.

We have some apps on django using uwsgi without any problems and we
are pretty happy with uwsgi but now one of the developers had the
brilliant idea of using virtualenv so I read about it and the concept
is to have all your app requirements in a folder and you create that
folder environment with a special command and so on but I have some
questions about using this with uwsgi :

if I use virtualenv and I installed uwsgi with python 2.7 can I still
use a virtualenv project created in pythong 2.6 ?

the python path for the different projects has to point to the virtual
env directory in that case ?

I try using dynamic apps in uwsgi passing the parameters through nginx
but I get always the same error.

My setup looks like this :

in my rc.conf ( FreeBSD) I had this :

uwsgi_flags="--pythonpath=/usr/local/www/dev.example.com/current/environment/bin
-w wsgi -s 172.16.30.36:5900 -b 500 -w index -p 50 -M -R 300 -l 4096
-t 60"

nginx config was like this :

server {
        listen       80;
        server_name  dev.example.com;
        client_max_body_size    50m;
        root  /usr/local/www/dev.example.com/current/appname;
        location / {
                index index.php index.html index.htm;
                location ~ /\. {
                    deny  all;
                }
                if (-f $request_filename) {
                    expires max;
                    break;
                }
                include uwsgi_params;
                uwsgi_pass   172.16.30.36:5900;
        }
}


I got this error :

Set PythonHome to /usr/local/www/dev.example.com/current/environment
ImportError: No module named site

Then I switched to this config on nginx :

server {
        listen       80;
        server_name  dev.example.com;
        client_max_body_size    50m;
        root  /usr/local/www/dev.wsbc.workatplay.com/current/appname;
        location / {
                index index.php index.html index.htm;
                location ~ /\. {
                    deny  all;
                }
                if (-f $request_filename) {
                    expires max;
                    break;
                }
                include uwsgi_params;
                uwsgi_param     UWSGI_PYHOME
/usr/local/www/dev.example.com/current/appname;
                uwsgi_param     UWSGI_CHDIR
/usr/local/www/dev.example.com/current/appname;
                uwsgi_param     UWSGI_SCRIPT    uwsgi;
                uwsgi_param     SCRIPT_NAME     /appname;
                uwsgi_pass   172.16.30.36:5900;
        }
}

and I started uwsgi like :

uwsgi -s 172.16.30.36:5900

and I got this error :

uWSGI Error

Python application not found

Can someone explain me what I'm doing wrong an how virtualenv supposed
to work with uwsgi ?

Thanks.

-- 
Jose Amengual
Senior System Administrator
Work at Play | The Creative Technology Agency
5th Floor, 329 Railway Street – Vancouver, BC V6A 1A4
o: 604.685.6418 x104 | c: 604.345.5767
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to