Python Forum
Flask, Self-hosted deployment, which server ? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: Flask, Self-hosted deployment, which server ? (/thread-33261.html)



Flask, Self-hosted deployment, which server ? - SpongeB0B - Apr-11-2021

Hi everyone,

On the official Flask support we can see listed under the Self-hosted options the ~following:

Standalone WSGI Containers
- Gunicorn
- uWSGI
- Gevent
- Twisted Web
- Proxy Setups

uWSGI

mod_wsgi (Apache)

FastCGI

CGI

and here they talk about : Waitress


I have no idea which one to choose ? what are the Cons & Pro..

Is the embedded flask server is not enough for a little application ?

Thanks


RE: Flask, Self-hosted deployment, which server ? - snippsat - Apr-11-2021

(Apr-11-2021, 06:33 AM)SpongeB0B Wrote: Is the embedded flask server is not enough for a little application ?
No,it's a development server so can do all development local to a finish app,if shall only run local can use it,
when finish and/if want to share with the world then need a production server.
I have used before Gunicorn in combo with Nginx,which is good combination,see that there is no Apache usage as Nginx is easier/ better.

Digital Ocean guides are good and updatet can be applied elsewhere even if not use DO.
How To Serve Flask Applications with Gunicorn and Nginx on Ubuntu 20.04
How To Serve Flask Applications with uWSGI and Nginx on Ubuntu 20.04

Heroku is another Python friendly host.
Heroku makes it easy to deploy and scale Python apps

An other way is to use a serverless compute service like AWS Lambda
Quote:Run code without thinking about servers or clusters. Only pay for what you use.
Deploy a Python API on AWS, Zappa - Serverless Python.