Introduction and overview of Flask Framework and how to install it?

In this tutorial, we are going to learn about the Flask Framework of Python. We can use this framework to create websites. We will also create a project using flask which will be a blog website and then we will deploy it to the web server using pythonanywhere.com.

(This tutorial is a part of a tutorial series in which we will learn how to make a very basic Blog Website using Flask and deploy it.)

 

What is Flask? – Overview

Flask is a microframework written in Python programming language which is used to create web applications. It is open-source in nature and is developed by Armin Ronacher. The Flask framework is based on the Werkzeug WSGI toolkit and the Jinja2 template engine.

The “micro” in microframework means here that we can generate a minimum or bare-bone website using flask and add functionalities when we need them. This leads to more understanding of the website for a web- developer as he/she adds more functionalities on their own.

This gives Flask a unique point to flask over other web-development tools, as it follows the bare-minimum approach and so simple to use and handle. For adding functionalities to our website, we can use various extensions available in flask.

Installation of Flask

(Note – Make sure that you already have python 3.x.x already installed on your system)

Creating a Virtual Environment:

Create a project folder and a flask_blog folder within:




mkdir flask blog
cd flask blog
python3 -m venv flaskblog

(where flaskblog is the name of the virtual environment)

Activating the Virtual Environment:

On Windows:

flaskblog\Scripts\activate

On Linux/Mac OS:

source flaskblog/bin/activate

Install Flask:

After activating the environment, use the following command –

pip install Flask

Flask is now installed on your machine, inside the virtual environment flaskblog.

 

I hope you understood what was explained in this tutorial. If you have any doubts or queries regarding anything explained here, please feel free to comment them down below.

Also, read:

 


Leave a Reply

Your email address will not be published. Required fields are marked *