Re: [flask] Deployment best practices
- zhang yang
- 2012-11-15 @ 21:15
I just read this article:
Flask/WSGI Application Deployment with Ubuntu, Ansible, Nginx, Supervisor
Hopefully, it is helpful.
On Thu, Nov 15, 2012 at 1:32 PM, Mark Grey <firstname.lastname@example.org> wrote:
> Hey All,
> Looking for some help understanding best practices deploying Flask.
> I am led to understand that the best way to deploy a flask app on a bare
> machine is some WSGI wrapper server (like gunicorn for ex) with nginx in
> front as the proxy for virtual hosting / static files. I am curious as to
> why there seems to be such a strong consensus about this and if anybody has
> had experience with alternative configurations.
> Right now, I have a staging environment set up using TwistedWeb. The
> server is on a development machine and uses twisted VHostResource and
> WSGIResource to setup all the virtual hosts our developers need to see
> the latest commits they make live in their browsers. I am hesitant to use
> this in any live environment since I put it together myself as a quick
> and dirty solution. I'm not nearly familiar enough with the innards of
> Twisted to feel confident with how I handled redirects and static routing,
> If one were to have multiple vhosts on a gunicorn (or any wrapper)
/nginxconfiguration, would I need to have multiple WSGI wrapper instances
> on different ports, one for each host, and have nginx proxy there?
> Doesn't this considerably complicate deployment?
> Thanks for the help!