Home » Python Flask Tutorial

Python Flask Tutorial

by Online Tutorials Library

Python Flask Tutorial

Flask Tutorial

Flask Tutorial provides the basic and advanced concepts of the Python Flask framework. Our Flask tutorial is designed for beginners and professionals.

Flask is a web framework that provides libraries to build lightweight web applications in python. It is developed by Armin Ronacher who leads an international group of python enthusiasts (POCCO).

What is Flask?

Flask is a web framework that provides libraries to build lightweight web applications in python. It is developed by Armin Ronacher who leads an international group of python enthusiasts (POCCO). It is based on WSGI toolkit and jinja2 template engine. Flask is considered as a micro framework.

What is WSGI?

It is an acronym for web server gateway interface which is a standard for python web application development. It is considered as the specification for the universal interface between the web server and web application.

What is Jinja2?

Jinja2 is a web template engine which combines a template with a certain data source to render the dynamic web pages.

Flask Environment Setup

To install flask on the system, we need to have python 2.7 or higher installed on our system. However, we suggest using python 3 for the development in the flask.

Install virtual environment (virtualenv)

virtualenv is considered as the virtual python environment builder which is used to create the multiple python virtual environment side by side. It can be installed by using the following command.

Once it is installed, we can create the new virtual environment into a folder as given below.

To activate the corresponding environment, use the following command on the Linux operating system.

On windows, use the following command.

We can now install the flask by using the following command.

However, we can install the flask using the above command without creating the virtual environment.

To test the flask installation, open python on the command line and type python to open the python shell. Try to import the package flask.

Flask Introduction

We have successfully installed the flask since we do not get the error in the process. Now, we can continue with the tutorial.

Prerequisite

Before learning Flask, you must have the basic knowledge of Python concepts.

Audience

Our Flask tutorial is designed to help beginners and professionals.

Problem

We assure you that you will not find any problem in this Python Flask tutorial. But if there is any mistake, please post the problem in the contact form.


You may also like