Hello, I have built a Flask application with a Python 3.6 virtual environment which I would like to run using NGINX Unit 1.1 instead of the usual "source venv/bin/activate; flask run". When I try to apply the following configuration
{ "listeners": { "*:5080": { "application": "myapp" } }, "applications": { "myapp": { "type": "python", "processes": 1, "module": "wsgi", "user": "nginx", "group": "nginx", "path": "/var/www/myapp" } } } My log file shows [info] 21422#21422 "myapp" application started [alert] 21422#21422 Python failed to import module "wsgi" [notice] 20803#20803 process 21422 exited with code 1 [warn] 20812#20812 failed to start application "myapp" [alert] 20812#20812 failed to apply new conf Here's my minimal wsgi.py: # /var/www/myapp/wsgi.py import mypackage if __name__ == "__main__": mypackage.run() The Flask application object is defined in mypackage.__init__.py: app = Flask(__name__) NGINX Unit does not know about the virtual Python environment at this time, and I don't know how I can set the required library paths. Can somebody please point me in the right direction? -Ralph _______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx