Video description
Learn techniques to develop industry-grade REST APIs with Python, Flask, Flask-RESTful, and FlaskSQLAlchemy
About This Video
- Get to grips with the development of resource-based, production-ready REST APIs
- Handle secure user registration and authentication with Flask
- Understand deployment complexities and the performance of Flask REST APIs
In Detail
Are you intrigued by how REST APIs use HTTP requests to accept data from clients and return data accurately? Equipped with the necessary skills, you can also develop professional-grade REST APIs and take your software development career to the next level. This video course will teach you how you can build REST API with Python, using Flask. The course starts with a Python refresher, which will take you from the basics to some of the most advanced features of Python. You'll then explore various aspects of writing a REST API and get to grips with the Flask-RESTful API for more efficient development. As you advance, you’ll store and retrieve resources in an SQL database and simplify storage with Flask SQLAlchemy. Next, you’ll create user and item models and become familiar with the Git repository, workflow, and security. Finally, you’ll deploy Flask apps to Heroku and secure your REST API with DNS and SSL certificates. By the end of this course, you’ll have the developed skills and confidence to build REST APIs with Flask.
Publisher resources
Table of contents
- Chapter 1 : Welcome!
-
Chapter 2 : A Full Python Refresher
- Introduction to This Section
- Variables in Python
- Solution to Coding Exercise: Variables
- String Formatting in Python
- Getting User Input
- Writing Your First Python App
- Lists, Tuples, and Sets
- Advanced Set Operations
- Solution to Coding Exercise: Lists, Tuples, and 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're a Bad Idea)
- Chapter 3 : Your First REST API
-
Chapter 4 : Flask-RESTful for More Efficient Development
- Virtualenvs and Setting up Flask-RESTful
- Your First Flask-RESTful API
- Test-First API Design—What Is That?
- Creating Your Item Resource
- The ItemList and Creating Items
- Improving Code and Error Control
- Authentication and Logging In — Part 1
- Authentication and Logging In — Part 2
- Using DELETE to Delete Items
- Using PUT to Create or Update Items
- Advanced Request Parsing with Flask-RESTful
- Optimising Your Final Code and Request Parsing
-
Chapter 5 : Storing Resources in a SQL Database
- Setting up Your Project
- Running the SQLite Database and Interacting with It from Python
- Logging In and Retrieving Users from a Database
- Signing Up and Writing Users to a Database
- Preventing Duplicate Usernames When Signing Up Users
- Retrieving Your Item Resources from a Database
- Writing Your Item Resources to a Database
- Deleting Your Item Resources from the Database
- Refactoring Insertion of Items
- Using the PUT Method with Database Interaction
- Retrieving Many Items from the Database
-
Chapter 6 : Simplifying Storage with Flask SQLAlchemy
- Setting up This Section's Project
- Improving the Project Structure and Maintainability
- Creating User and Item Models
- Verifying the App Using Postman
- Advanced Postman: Environments and Tests
- Tables and Columns in SQLAlchemy
- Implementing the ItemModel Using SQLAlchemy
- Implementing the UserModel Using SQLAlchemy
- Easily Displaying the ItemList Resource with SQLAlchemy
- No More Creating Tables Manually—Using SQLAlchemy to Create Tables
- Creating a New Model: StoreModel
- Creating the Store Resource
- Final Testing of This Section's API
- Chapter 7 : Git - Version Control
- Chapter 8 : Deploying Flask Apps to Heroku
- Chapter 9 : Deploying a Server to Your Own Server
- Chapter 10 : Security in Your Rest API
-
Chapter 11 : Token refreshing and Flask-JWT extended
- A Recap of the Code + a Few Changes!
- Creating a User Resource for Testing
- Testing Your New Resource with Postman
- Logging in with Flask-JWT-Extended
- Testing the Login with Postman
- Adding JWT Claims
- Getting the JWT Identity in and Endpoint and @jwt_optional
- What is a Fresh Token?
- Performing Token Refresh in Your Rest API
- Requiring a Fresh Token in an Endpoint
- Customizing Flask-JWT-Extended Callbacks and Responses
- Blacklisting with Flask-JWT-Extended
- Logging Out Users in Your Rest API
Product information
- Title: REST APIs with Flask and Python
- Author(s):
- Release date: August 2017
- Publisher(s): Packt Publishing
- ISBN: 9781788621526
You might also like
video
Python Django Dev To Deployment
Learn Python and build & deploy a real estate application using the Django framework & PostgreSQL …
video
Modern JavaScript From The Beginning
Learn and Build Projects with Pure JavaScript (No Frameworks or Libraries) About This Video Understanding of …
video
Advanced REST APIs with Flask and Python
Take your REST APIs to a whole new level with this advanced Flask and Python course! …
video
React - The Complete Guide (incl. Hooks, React Router and Redux)
Dive in and learn React from scratch! Learn Reactjs, Redux, React Routing, Animations, Next.js basics and …