I'm running django+nginx+uwsgi. For some reason I cannot start uWSGI without setting home option, pointing to virtual environment. Whenever I start uWSGI without it, it says that it cannot find module django.core.wsgi, like if python path was empty (but django 1.4 is installed system-wide).
How can i fix it?
Can I then ditch NGINX? uWSGI could be used as a standalone web server in production, but that is not it's intentional use. It may sound odd, but uWSGI was always supposed to be a go-between a full-featured web server like NGINX and your Python files.
Nginx natively includes support for upstream servers speaking the uwsgi protocol since version 0.8.
uWSGI (source code), pronounced "mu wiz gee", is a Web Server Gateway Interface (WSGI) server implementation that is typically used to run Python web applications.
Since I hit my head on this problem too, let's write an answer for all. :)
The problem is that, when starting in emperor mode (system wide), the uwsgi master process can't (or won't) load the correct environ for 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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With