python - How do I run uwsgi with virtualenv -
i'm developing first real python flask project , set build server deploy "latest build" built on every check-in.
i have set startup script start application using uwsgi , part working fine. have started using virtualenv
, doing packages installed added project under projectname\flask\lib\site-packages
.
i'm using nginx
web server , config looks this:
location / { try_files $uri @graderbuild; } location @graderbuild { include uwsgi_params; uwsgi_param uwsgi_chdir /usr/local/grader/build; uwsgi_param uwsgi_pyhome /usr/local/grader/build; uwsgi_pass 127.0.0.1:3031; }
i'm starting uwsgi
using this:
exec /usr/local/bin/uwsgi --master --socket 127.0.0.1:3031 --wsgi-file restserver.py --callable app --processes 4 --die-on-term --threads 2 >> /var/log/grader-build.log 2>&1
now know if i'm doing right... deploying entire folder build server. don't want install global python modules build work. right or wrong?
the error is:
importerror: no module named flask_wtf
if i'm right, how configure setup use virtualenv
site-packages? preferred location in startup
script , not in nginx
config.
use -h
set virtualenv python path.
uwsgi -h /path/to/your/virtualenv
http://uwsgi-docs.readthedocs.org/en/latest/options.html#virtualenv
Comments
Post a Comment