Course: REST APIs with Flask and Python in 2024
Modules:
Promotion
Introduction to this section, Variables in Python, Solution to coding exercise: Variables, String formatting in Python, Getting user input, Writing our first Python app, Lists, tuples, and sets, Advanced set operations, Solution to coding exercise: Lists, tuples, sets, Booleans in Python, If statements, The 'in' keyword in Python, If statements with the 'in' keyword, Loops in Python, Solution to coding exercise: Flow control, List comprehensions in Python, Dictionaries, Destructuring variables, Functions in Python, Function arguments and parameters, Default parameter values, Functions Returning Values, Solution to Coding Exercise: Functions, Lambda Functions in Python, Dictionary Comprehensions, Solution to Coding Exercise: Dictionaries and Students, Unpacking Arguments, Unpacking Keyword Arguments, Object-Oriented Programming in Python, Magic Methods: ..str.. and ..repr.., Solution to Coding Exercise: Classes and Objects, @classmethod and @staticmethod, Solution to Coding Exercise: @classmethod and @staticmethod, Class Inheritance, Class Composition, Type Hinting in Python 3.5+, Imports in Python, Relative Imports in Python, Errors in Python, Custom Error Classes, First-Class Functions, Simple Decorators in Python, The "at" Syntax for Decorators, Decorating Functions with Parameters, Decorators with Parameters, Mutability in Python, Mutable Default Parameters (and Why They Are a Bad Idea)
Overview of the project we'll build, Initial set-up for a Flask app, Your first REST API endpoint, What is JSON?, How to interact with and test your REST API, How to create stores in our REST API, How to create items in each store, How to get a specific store and its items
What are Docker containers and images?, How to run a Flask app in a Docker container, How to run the Flask REST API with Docker Compose
Data model improvements for our API, General improvements to our first REST API, New endpoints for our first REST API, How to run the API in Docker with automatic reloading and debug mode, How to use Blueprints and MethodViews in Flask, How to write marshmallow schemas for our API, How to perform data validation with marshmallow, Decorating responses with Flask-Smorest
Overview and why use SQLAlchemy, How to code a simple SQLAlchemy model, How to write one-to-many relationships using SQLAlchemy, How to configure Flask-SQLAlchemy with your Flask app, How to insert data into a table using SQLAlchemy, How to find models in the database by ID or return a 404, How to update models with SQLAlchemy, How to retrieve list of all models, How to delete models with SQLAlchemy, Deleting related models with cascades, Conclusion of this section
Changes in this section, One-to-many relationship between stores and tags, Many-to-many relationship between items and tags
Who uses the JWT?, How to set up Flask-JWT-Extended with our app, Coding the User model and schema, How to add a register endpoint to the REST API, How to add a login endpoint to the REST API, Protect endpoints by requiring a JWT, JWT claims and authorization, How to add logout to the REST API, Request chaining with Insomnia, Token refreshing with Flask-JWT-Extended
How to add Flask-Migrate to our Flask app, Initialize your database with Flask-Migrate, Change SQLAlchemy models and generate a migration, Manually review and modify database migrations
What are Git repositories and commits?, Initialize a Git repository for our project, Writing Markdown for documents and commits, Remote repositories and how to use them, Git branches and merging, Merge conflicts and how to resolve them, Overview of the final e-book chapters
Creating a Render.com web service, How to run Flask with gunicorn in Docker, Get a deployed PostgreSQL database, Run the app and database locally with Docker Compose, Use PostgreSQL locally and in production, Test the finished production app
How to send emails with Python and Mailgun, How to send emails when users register, What is a task queue and setting up a Redis database, How to Populate and consume the task queue with rq, How to process background tasks with the rq worker, How to send HTML emails using Mailgun and Python, How to deploy a background worker to render.com