Exploring the Flask framework: Building Web Apps with Python -2

Pytech Academy
6 min readAug 21, 2023

Introduction:

In this tutorial, we'll walk through the process of building an "AreaCalculator" web app using Python's Flask framework and Bootstrap for styling. This app will allow users to calculate the areas of circles, triangles, and rectangles effortlessly. Before we begin, make sure you have a basic understanding of Python, Flask, and HTML. Read the first article here to have a better understanding.

Setting up the project:

AreaCalculator/
├── static/
│ ├── css/
│ │ └── style.css
│ ├── images/
│ │ └── favicon.png
├── templates/
│ ├── layout/
│ │ └── base.html
│ ├── index.html
│ ├── circle.html
│ ├── triangle.html
│ └── rectangle.html
└── app.py
  • static/: This directory is typically used to store static files such as CSS stylesheets, JavaScript files, and images. In your case, you have a css subdirectory and an images subdirectory.
  • css/: This subdirectory is meant for storing your CSS files. Inside, you have a file named style.css, which likely contains the styling rules for your web application's visual appearance.
  • images/: This subdirectory is intended for storing image files. You have…

--

--

Pytech Academy

Python, web apps with Streamlit/Flask, AI/ML - Learn it all at Pytech Academy! Master coding and build projects in Python. #PytechAcademy