ruebenramirez / blog

My blog
http://blog.ruebenramirez.com/
7 stars 0 forks source link

serving flask with uwsgi #243

Open ruebenramirez opened 8 years ago

ruebenramirez commented 8 years ago

great resource on this topic: http://vladikk.com/2013/09/12/serving-flask-with-nginx-on-ubuntu/

ruebenramirez commented 8 years ago

but what if you don't have a virtualenv for your project? (answer: you're doing it wrong)

If you really dont want to use a virtualenv, then use this for home value in the uwsgi.ini:

python (PYTHONPATH). Using virtualenv you specify the environ. Without it you need to set the pythonpath variable, even multiple times pointing to the system-wide python paths.

Just as an example, for my system it's:

pythonpath = /usr/local/lib/python2.7/dist-packages
pythonpath = /usr/lib/python2.7

(using the ini syntax)

source: http://stackoverflow.com/a/15707326