🔥 How to host your python flask website free in Heroku 🔥

🔥 How to host your python flask website free in Heroku 🔥

💥 Follow this simple steps to host your python flask application on Heroku 💥

What is Flask?

Flask is a web application framework written in Python. Flask is based on the Werkzeug WSGI toolkit and Jinja2 template engine. Both are Pocco projects. This post revolves around how to deploy a flask app on Heroku. To demonstrate this, we are first going to create a sample application for a better understanding of the process.

Prerequisites:

  • Python
  • pip
  • Git
  • VS code(editor)

STEP 1 : Let’s create a simple flask application first and then it can be deployed to heroku. Create a folder named "eagle_programming" on your computer. Open that folder in VS code editor and create a “Procfile” and write the following code.

image.png

STEP 2 : Create “requirements.txt” and write the following requirements.

image.png

STEP 3:Create app.py and write the following code.

image.png

STEP 4: Initialize an empty repo, add the files in the repo and commit all the changes.

image.png

STEP 5 : Create account in Heroku and Login to heroku CLI using "heroku login" command and Now, Create a unique name for your Web app.

image.png

STEP 6: Push your code from local to the heroku remote.

image.png Finally, our web app will be deployed on eagleprogramming.herokuapp.com