GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Python Tutorial
  • Data Types
  • Interview Questions
  • Examples
  • Quizzes
  • DSA Python
  • Data Science
  • NumPy
  • Pandas
  • Practice
  • Django
  • Flask
  • Basics & Installation
  • Django vs Flask

This view

  • Original page
  • New address

GeezerVison is showing www.geeksforgeeks.org — Flask Tutorial - GeeksforGeeks

geeksforgeeks
search icon
  • Courses
  • Tutorials
  • Interview Prep
  • Python Tutorial
  • Data Types
  • Interview Questions
  • Examples
  • Quizzes
  • DSA Python
  • Data Science
  • NumPy
  • Pandas
  • Practice
  • Django
  • Flask

Flask Tutorial

Last Updated : 30 Jun, 2026

Flask is a lightweight web framework used to build web applications and APIs. It follows a minimal design and provides core features like routing, request handling and template rendering while allowing developers to add extensions as needed. It is widely used for building small to medium web applications due to its simplicity and flexibility.

  • Microframework: Lightweight framework with minimal dependencies, giving developers full control over application structure.
  • Werkzeug & Jinja2: Uses Werkzeug for request/response handling and Jinja2 for dynamic HTML templating.
  • Routing: Maps URLs to Python functions using simple decorators.
  • Flexible Database Choice: No built-in ORM, allowing use of tools like SQLAlchemy or raw SQL.
  • API Development: Well-suited for building RESTful APIs and backend services.
  • Development Server: Includes a built-in server for local testing during development.

Introduction

This section introduces Flask, compares it with Django and shows how to install it on Windows to start building web applications.

  • Basics & Installation
  • Django vs Flask

Quick Start

Covers creating and running a basic Flask app, understanding routes, HTTP methods, variables, redirects and basic configurations.

  • First App
  • Running an App
  • Routes
  • Models
  • Python Flask - Request Object
  • HTTP Method
  • Variable Rules
  • Redirect and Errors
  • Change Port
  • Changing Host IP Address
  • Process Incoming Request Data

Templates and Static Files

Explains creating dynamic web pages using templates and managing static files like CSS, JavaScript and images.

  • Templates
  • Template Inheritance
  • Static Files

Form Handling

This section covers capturing user input, form validation, file uploads and security features like CSRF protection.

  • Flask-WTF
  • Handling File Uploads
  • CSFR Protection
  • Retrieving HTML Form data
  • Use Web Forms

Configuration

It explains how to manage application settings such as debug mode, secret keys and environment-based configurations.

  • App Configuration
  • Environment-Specific Configuration

Database

Flask supports multiple databases for storing and managing data, including SQLite, PostgreSQL, MySQL, MongoDB and also allows using SQLAlchemy or executing raw SQL queries.

  • SQLAlchemy
  • SQLite
  • MongoDB Database
  • PostgreSQL Database
  • Login & Registration Project MySQL
  • Filtering, Sorting, and Pagination in Flask
  • Execute Raw SQL in SQLAlchemy

Middlewares

This section covers how middleware processes requests and responses for tasks like logging, authentication and modifications.

  • Middlewares
  • WSGI Middleware

Authentication

Authentication is used to verify user identity and manage secure access to applications. It includes login systems, password hashing, session management and permission control.

  • Adding Authentication
  • Display Current Username
  • Password Hashing with Bcrypt
  • Store username and password
  • Role-Based Access Control
  • Sessions to server Logout
  • JWT
  • Cookies
  • JSON Response

Rest APIs

Flask makes building REST APIs easy by handling requests like GET, POST, PUT and DELETE. With Flask-RESTful, one can send and receive JSON data, manage authentication and secure the API.

  • Creating Rest APIs
  • Flask-CORS
  • RESTful Extension
  • Serialization and Deserialization

Advanced Topics

Introduces advanced concepts like asynchronous programming, WebSockets and modular app structure using blueprints.

  • Asynchronous Programming
  • Web Sockets
  • Blueprints

Deployment & Error Handling

After development, Flask apps must be deployed and properly handle errors. This section covers deployment methods and techniques for managing application errors.

  • Subdomain
  • Handling 404 Error
  • Dockerization
  • Deploying App on Heroku
  • Deploying ML Model

Projects

This section includes practical Flask projects that demonstrate real-world applications such as portfolio websites, APIs, data visualization and sentiment analysis tools.

  • Todo List App
  • Single Page Portfolio
  • Profile Application
  • Wikipedia Search App
  • Twitter Sentiment Analysis
  • Cricket Score API using Web Scraping
  • Adding Graphs to Flask Apps
  • Projects Archives 

Additional Resources

This section provides helpful articles and references to deepen understanding of Flask and related topics.

  • Career Opportunities
  • Interview Questions and Answers
Comment

Explore

    Python Fundamentals
    • Introduction1 min read
    • Input & Output2 min read
    • Variables4 min read
    • Operators4 min read
    • Keywords2 min read
    • Data Types4 min read
    • Conditional Statements3 min read
    • Loops3 min read
    • Functions4 min read
    Python Data Structures
    • String4 min read
    • List3 min read
    • Tuples3 min read
    • Dictionary3 min read
    • Set2 min read
    • Arrays5 min read
    Advanced Python
    • OOP Concepts3 min read
    • Exception Handling5 min read
    • File Handling4 min read
    • Python Database2 min read
    • MongoDB3 min read
    • MySQL7 min read
    • Packages4 min read
    • Modules3 min read
    • DSA Libraries5 min read
    • Python GUI2 min read
    Data Science with Python
    • Numpy3 min read
    • Pandas4 min read
    • Matplotlib3 min read
    • Seaborn3 min read
    • StatsModel2 min read
    • Model Building6 min read
    • TensorFlow2 min read
    • PyTorch5 min read
    Web Development with Python
    • Flask3 min read
    • Django5 min read
    • Django ORM4 min read
    • Jinja2 Templating5 min read
    • Django Templates5 min read
    • REST API3 min read
    • Build API with DRF4 min read
    Python Practice
    • Quiz1 min read
    • Practice Problems2 min read
    • Interview Q & A15+ min read
    Courses
    • Placement 360 Course2 min read
    • Data Science 360 Course2 min read
    • AI Engg Course2 min read
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.