Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Treehouse

Flask REST API Course (How To)

via Treehouse

Overview

Building an API with Flask can be pretty simple but you'll often end up with a large amount of code in just one or two files. In other words, it can be messy! But with a few simple tools like Flask-RESTFul, Flask-Limiter, and Flask-HTTPAuth, you can build a clean, well-organized, and strong API with this great, lightweight Python framework.

What you'll learn

  • Flask-RESTful
  • Token authentication
  • Rate limiting

Syllabus

Resourceful Blueprints

The backbone of your Flask API is the Resource class from Flask-RESTful. You'll build strong, intelligent resources and then link them and your Flask app together using the Blueprint feature from Flask itself.

Chevron 12 steps
  • What We're Going to Build

    2:17

  • Models

    6:41

  • Resources

    5:11

  • Ingredient Resource

    2 objectives

  • Blueprints

    7:25

  • Register API

    4 objectives

  • Reqparse

    9:15

  • Parse the Request

    1 objective

  • Marshalling

    12:18

  • Ingredient Fields

    2 objectives

  • Beyond GET and POST

    10:05

  • Status Codes

    1 objective

API Protection

You have a great API but it's wide open to the world. Time to put some locks on the doors with authentication and prevent a stampede with rate limiting. A couple of great Python and Flask packages will handle all of this.

Chevron 8 steps
  • Hashing Users

    7:45

  • Password hashing

    3 objectives

  • User Resource

    6:58

  • Create User

    2 objectives

  • HTTP Basic Auth

    9:59

  • Generating Tokens

    10:34

  • Rate Limiting

    8:59

  • Review: Flask REST API

    10 questions

Reviews

Start your review of Flask REST API Course (How To)

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.