Python - Flask Web Framework

Flask is a lightweight WSGI (Web Server Gateway Interface) web framework . It's a microframework written in Python. It was developed by Armin Ronacher.Flask depends on the Jinja2 template engine and the Werkzeug WSGI toolkit.

What is Werkzeug?

Werkzeug is a extensive (Web Server Gateway Interface) WSGI web application library. It is a full-featured request object with objects to interact with headers, form data, cookies and files.

What is Jinja2?

Jinja2 is a template engine written in Python. It was made after Django’s template. It's used to generate HTML,XML or any markup formats.

      {% for user in data.userlist %}
      {% endfor %}

Flask installation

we can install and update flask using pip.

pip install flask

Simple Web Page


from flask import Flask

app = Flask(__name__)

def index():
	return "<h1>Welcome to Flask</h1>"
if __name__=='__main__':

Run the Project:

  1. Run 'app.py' file.
  2. Browse the URL 'localhost:5000'.


Simple Web Page using Flask