Building a Web Application with Python 3 and Flask

Hilal Gevrek
4 min readNov 29, 2023

Flask is a popular web framework for building web applications using the Python programming language.

A Web Application Framework or a simply a Web Framework represents a collection of libraries and modules that enable web application developers to write applications without worrying about low-level details such as protocol, thread management, and so on.

Let’s create a web application using Python 3 and Flask.

1. Create an Environment and Install Flask

It is important to install Flask in a virtual environment to avoid problems with conflicting libraries.

First, make a separate directory for your project and move into the directory.

These commands are suitable for Windows operating system, and you can use Command Prompt for the commands. If you are using it on other operating systems, remember to adapt the commands accordingly.

mkdir <project name>
cd <project path>

Next, create and name a virtual environment in Python 3 and activate the environment. When you create the environment, a new folder appears in your project directory with the environment’s name.

py -3 -m venv <name of environment>
<name of environment>\Scripts\activate

Then, install Flask within the activated environment using pip.

pip install Flask

--

--