Welcome! Log In Create A New Profile

Advanced

Re: Flask app with virtual Python environment in Unit 1.1 ?

Ralph Seichter
April 29, 2018 12:04PM
On 29.04.18 17:06, Valentin V. Bartenev wrote:

> You can set a path to Python virtual environment using the "home"
> parameter of application object.

Ah, that was the missing piece, thank you.

> Please also note that your application callable need to be named
> "application" (not "app").

Alright, I changed my wsgi.py to this:

from mypackage import app as application
if __name__ == "__main__":
application.run()

My application can now be called via NGINX -> NGINX Unit -> App, which
is exactly what wanted. It also requires certain environment variables
to be set, and I am now wondering how to pass these on? I found the
enhancement request https://github.com/nginx/unit/issues/12 but since
this feature does not seem to be implemented yet, what is the
recommended method to pass env variables to Unit workers?

-Ralph
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Flask app with virtual Python environment in Unit 1.1 ?

Ralph Seichter April 29, 2018 10:12AM

Re: Flask app with virtual Python environment in Unit 1.1 ?

Valentin V. Bartenev April 29, 2018 11:08AM

Re: Flask app with virtual Python environment in Unit 1.1 ?

Ralph Seichter April 29, 2018 12:04PM

Re: Flask app with virtual Python environment in Unit 1.1 ?

Valentin V. Bartenev April 29, 2018 05:04PM

Re: Flask app with virtual Python environment in Unit 1.1 ?

Ralph Seichter April 30, 2018 05:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 164
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready