Say you’ve written a really cool script in Python to do some interesting data analysis and now you want to demonstrate it to others. Chances are, sending over a .py file and asking others to run it, or demonstrating yourself running it on the command line won’t have the same grasp as a nicely packaged and polished web application. By using the Python package flask, we can create one of these interactive applications fairly quickly. In this article, I will make a simple web application that displays the number of times the homepage was visited and deploy it on Heroku to share with others.
Note — All screenshots below are taken by the author.
Setup project and folder hierarchy
The easiest way to deploy our project downstream is to create a new repository on GitHub, where all of our files will live. So I started by creating a new repo at github.com/n-venkatesan/sample-webapp and cloning it to my local computer. When creating the repository, you have the option of initializing with a .gitignore file — I would recommend choosing Python from the dropdown menu to avoid unnecessary files being checked into Git.

#heroku #python #flask #web-development #data-science

Create and Deploy a Simple Web Application with Flask and Heroku
1.30 GEEK