Python Flask

From Script | Spoken-Tutorial
Jump to: navigation, search

Web application frameworks have become ubiquitous in developing a web application. They aid in developing dynamic web applications. Flask is a simple, powerful, and easy-to-learn Python micro framework. It is also one of the most widely used open source web application frameworks. In this series the learners will learn about the fundamental concepts of web development with hands-on experience to build a web app with Flask. Flask is light-weight and easy to extend. Therefore it is possible to extend the functionalities of the web app by integrating it with third-party APIs. Flask uses Jinja2 templating engine. We will cover models, views, controllers, web templates, forms, validation and integration with different third party packages etc. On completion of this course the learner will be fully equipped to build her own web application using the Flask micro framework.

Learners: UG/PG CSE/IT/CS students

Basic Level

  1. Installation of Python Flask
    • Python Virtual Environment
    • Install pip3
    • Install virtualenv
    • Create a Virtual Environment
    • Activate the Virtual Environment
    • Install Flask
    • Write a Hello World Flask app
    • Start the Flask development server
    • Accessing Flask app via web browser
    • Stop the Flask development server
    • Deactivate Virtual Environment
  2. First Flask Web App
    • First Flask web app
    • Importing flask module
    • Python Decorators
    • Web Server Gateway Interface
    • Routes in Flask
    • Static Routes
    • View Functions
    • Dynamic Routes
    • 404 HTTP code
    • Running web app in the web browser
  3. Request Response Cycle in a Flask Web App
    • Request response cycle in Flask
    • Method attribute of the request object
    • Sending data from client to server
    • Query Arguments
    • Form attribute of request object
    • GET and POST methods
    • 400 HTTP status code
    • Starting the server in Debug Mode
    • Cascading errors
    • 500 HTTP status code
  4. Introduction to Flask Templates
    • Use of templates in Flask
    • Use of variables inside templates
    • Introduction to MVC Architecture
    • Model, View, Controller
    • render_template() method
    • Dynamic pages
    • Passing variables to HTML
    • Jinja templating language
    • Inheritance of HTML code
    • Rendering templates

Contributors and Content Editors