Getting Started

Summary: Like Django, Flask is also a framework, written in python. Although it serves almost the same feature as Django, Web Application development, it is considered and named as a micro web framework.

Hands on Flask, the Complete Guide 

Like Django, Flask is also a framework, written in python. Although it serves almost the same feature as Django, Web Application development, it is considered and named as a micro web framework.

Flask, a micro web Framework, based on Werkzeug, Jinja2 and inspired by Sinatra Ruby framework, called so because it does not require particular tools or libraries.

Unlike Django, it doesn’t come up with form validation, abstraction layer. It has its own importance that’s why it is free and so popular among developers with 44k GitHub stars.

Installation

Flask is an open source free software tool available free for installation.

Since it is python based on the presence of python in your system is a must.

Make sure the pip is installed and running in its updated version.

Flask installation

$ pip install Flask

$ FLASK_APP=hello.py flask run

* Running on http://localhost:8000/

Instead of being a Micro web development framework and tiny in size, it comes up with a great feature of extension. An extension can add application feature to the flask as if they implemented in flask itself.

Features of Flask

Flask was intended to be anything but difficult to utilize and extends. The thought behind Flask is to assemble a strong establishment for web applications From that point on you are allowed to connect any extensions you think you need. Likewise, you are allowed to assemble your very own modules.

Flask is easy to start as a beginner as its own code and concept are low as compared to Django, here is a “hello world” from Flask.

from flask import Flask

app = Flask(__name__)

 @app.route('/')

def hello_world():

   return 'Hello, World!'

 if __name__ == '__main__':

   app.run()

The Extension

The Flask framework is made great by having a special feature of adding extensions here is how we could find and add extensions or plugins to Flask.

First of all finding the extension of use, it could be found on Flask Extension Registry by visiting here: http://flask.pocoo.org/extensions/

After finding the required extension it could be easily installed with easy install and pip. Also, add it to the requirments.txt file.

Using

import <extension_name>

There are several other Features of Flask Framework listed as

  • Built-in Development server and Fast Debugger.

  • Unit testing support as integrated.

  • The whole core is based on Unicode.

  • Support for Secure cookies.

  • HTTP request handling.

  • Great documentation as in comprehensive style

It can be found here http://flask.pocoo.org/docs/1.0/

Thus, Flask is a concise but powerful framework, easy to start as a beginner with great extension properties, also comes with many features and reasons to use.

 

 

 

 


If you like it you can donate :)

share

Comments

Sign in to publish a comment

0 comments

Be the first to comment on this post.