Run a Flask App with WSGI and NGINX on EC2

In the previous post titled Create a Simple Flask App on EC2, we create a simple Hello World Flask app and deployed it on an EC2 instance. On running our app, we say a warning message that read –

WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.

What this is telling us is that, while Flask has an inbuilt web server and serves our purpose for development, it is not suitable for production. In this post, we will further our previous post, and use WSGI server to talk to our Flask app and NGINX to handle the traffic between WSGI server and our web browser.

Continue reading “Run a Flask App with WSGI and NGINX on EC2”

Create a Simple Flask App on EC2

Recently, I was faced with a situation where I had to quickly create a simple service in Python that I could invoke and run some real time tests based on the input data. I spend a few minutes searching about the quickest way to achieve this and came across Flask. It is very easy to develop a Flask app, or to convert an existing Python app to use Flask and make it in a service. It is not something we will use in production as is, but for development, it totally works awesome.

Continue reading “Create a Simple Flask App on EC2”