O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building RESTful Python Web Services with Flask

Video Description

Create lightweight, maintainable, scalable, and secure web apps using the best tools and techniques

About This Video

  • Develop RESTful web services using the most popular frameworks in Python
  • Configure and fine-tune your APIs using the best tools and techniques available
  • This practical guide will help you implement complete REST-based APIs from scratch

In Detail

Python is the language of choice for millions of developers worldwide, due to its gentle learning curve as well as its vast applications in day-to-day programming. It builds great web services in the RESTful architecture. This video will show you the best tools you can use to build your own web services. Learn how to develop RESTful APIs using the popular Python frameworks and all the necessary stacks with Python and Flask, combined with related libraries and tools. We will delve into the framework for building various web services. We will show you everything required to successfully develop RESTful APIs with the Flask framework, such as request handling, URL mapping, serialization, validation, authentication, authorization, versioning, databases, and asynchronous callbacks. At the end of the framework, we will add authentication and security to the RESTful APIs and prepare tests for them. By the end of the video, you will have a deep understanding of the stacks needed to build RESTful web services.

Table of Contents

  1. Chapter 1 : Developing RESTful APIs with Flask
    1. The Course Overview 00:03:28
    2. CRUD Operations in Flask 00:04:52
    3. Setting Up the Virtual Environment with Flask 00:02:14
    4. Declaring Status Codes for the Responses 00:02:45
    5. Using a Dictionary as a Repository 00:04:30
  2. Chapter 2 : Working with the Flask API
    1. Working with Resourceful Routing 00:07:38
    2. Configuring Resource Routing and Endpoints 00:03:51
    3. Working with Command-Line Tool – HTTPie 00:06:45
    4. Working with GUI Tool – Postman 00:03:59
  3. Chapter 3 : Working with SQLAlchemy in Flask
    1. Designing a RESTful API with a PostgreSQL Database 00:02:31
    2. Installing Packages to Simplify our Common Tasks 00:03:16
    3. Creating and Configuring the Database 00:03:16
  4. Chapter 4 : Working with Models and Blueprints in Flask
    1. Creating Models with Their Relationships 00:03:54
    2. Creating Schemas to Validate, Serialize, and Deserialize Models 00:05:57
    3. Combining Blueprints with Resourceful Routing 00:12:18
    4. Registering the Blueprint and Run Migrations 00:06:23
    5. Creating and Retrieving Related Resources 00:04:30
  5. Chapter 5 : Improving Authentication to an API with Flask
    1. Improving Unique Constraints in the Models 00:05:13
    2. Updating Fields for a Resource with the PATCH Method 00:02:27
    3. Coding a Generic Pagination Class 00:05:15
    4. Adding Pagination Features to the API 00:03:52
    5. Understanding the Steps to Add Authentication and Permissions 00:02:31
  6. Chapter 6 : Adding Authentication to an API with Flask
    1. Adding a User Model 00:04:29
    2. Adding Authentication to Resources 00:03:13
    3. Creating Resource Classes to Handle Users 00:04:41
    4. Running Migrations to Generate the User Table 00:03:16
    5. Composing Requests with the Necessary Authentication 00:03:30
  7. Chapter 7 : Testing and Deploying an API with Flask
    1. Setting Up Unit Tests 00:02:49
    2. Defining a First Round of Unit Tests 00:07:22
    3. Running Unit Tests with nose2 00:03:46
    4. Improving Test Coverage 00:03:49
    5. Understanding Strategies for Deployments and Scalability 00:02:30