Advanced REST APIs with Flask and Python

Video description

Take your REST APIs to a whole new level with this advanced Flask and Python course!

About This Video

  • Integrate advanced functionality (such as image uploading, payments, or user confirmation e-mails) in your API
  • Improve operations in existing REST APIs with database migrations and extensive refactoring knowledge
  • Take your REST API development to a whole new level by getting familiar with more of the Flask ecosystem

In Detail

This Advanced REST API course takes your REST API development to a whole new level by familiarizing you with more of the Flask ecosystem. We start with a simple REST API and teach you everything you need to know about it. We introduce new features and technologies by baking them into this application so you can see how a professional REST API is developed. Every new feature is added to a fully working application and tested. We also help you understand more about how to build features incrementally so you can get them to your users quickly and minimize risk.

Remember, this is our most advanced course yet! You should have adequate programming experience with Python or another programming language. Some knowledge of how the web works will also be helpful.

You should have prior knowledge of how to install Python packages and how to run your Python applications. If you've used virtualenv or Pipenv before, that's excellent! Knowledge of how to use PyCharm for debugging is also a plus, although we cover using the debugger in the course!

Publisher resources

Download Example Code

Table of contents

  1. Chapter 1 : Introduction
    1. Introduction to this section 00:00:58
    2. Our project and endpoints 00:05:44
    3. Reviewing the beginner course code 00:09:54
    4. Simplifying our error handling 00:01:49
    5. Refactoring our resources 00:04:13
    6. Should we have unique names? 00:04:22
    7. Adding basic type hinting 00:08:33
    8. Adding custom JSON types 00:06:45
    9. Using the current class as a type hint 00:03:13
    10. Using Black for code formatting 00:10:09
    11. Improving errors with constants 00:08:03
    12. @classmethod across the board 00:06:57
    13. Testing our API with Postman 00:09:21
    14. Conclusion of this section 00:00:37
  2. Chapter 2 : Serialization with Marshmallow
    1. Introduction to this section 00:00:42
    2. Serialization with Marshmallow 00:08:45
    3. Deserialization with Marshmallow 00:06:17
    4. Migrating from virtualenv to Pipenv 00:16:15
    5. Using vanilla Marshmallow with the API 00:14:24
    6. Introduction to Flask-Marshmallow 00:13:30
    7. Adding items to our REST API 00:12:38
    8. Adding stores to our REST API 00:09:28
    9. Deduplicating error handling 00:04:20
    10. Conclusion of this section 00:00:48
  3. Chapter 3 : E-mail confirmations
    1. Introduction to this section 00:01:39
    2. Introduction to e-mail confirmation 00:05:32
    3. Adding an activated property 00:03:29
    4. Activating users manually 00:06:00
    5. Telling users, they are active 00:15:28
    6. Setting up Mailgun 00:03:13
    7. Sending e-mails with Mailgun (Part 1) 00:13:51
    8. Sending e-mails with Mailgun (Part 2) 00:03:44
    9. Creating our Mailgun library file 00:07:56
    10. Using .env files in Flask 00:05:49
    11. Adding more configuration to. Env 00:01:53
    12. Error handling in Mailgun 00:09:11
    13. Conclusion of this section 00:01:15
  4. Chapter 4 : Advanced e-mail confirmation
    1. Introduction to this section 00:01:08
    2. Creating the Confirmation Model 00:15:30
    3. Changes in our User Model 00:08:12
    4. Creating our Confirmation Resource 00:17:25
    5. Updating our User Resource 00:05:04
    6. Adding the last confirmation to the user schema 00:03:28
    7. Fixing our app.py 00:06:26
    8. Cross-resource dependencies are (generally) bad 00:05:02
    9. What are localisation and internationalisation? 00:11:41
    10. Storing strings in config files 00:04:12
    11. Creating a simple translation library 00:09:44
    12. Updating our resources to use translations 00:10:55
    13. Adding a new language to our API 00:05:23
    14. What is Flask-Babel? 00:05:58
    15. Common pitfalls and advice 00:03:57
    16. Conclusion of this section 00:01:57
  5. Chapter 5 : Postman documentation and tests
    1. Introduction to this section 00:01:28
    2. Collection and request descriptions 00:04:08
    3. Recap of Postman environments 00:04:37
    4. JavaScript tests in Postman 00:14:07
    5. Running entire collections in Postman 00:15:35
    6. Adding example requests and responses 00:08:48
    7. Previewing our Postman documentation 00:00:35
    8. Publishing our documentation page 00:03:47
    9. More options for publishing documentation 00:06:27
    10. Conclusion of this section 00:00:59
  6. Chapter 6 : Image uploads
    1. Introduction to this section 00:00:34
    2. Installing Flask-Uploads 00:01:34
    3. Config files in Flask 00:16:41
    4. What are wsgi and Werkzeug? 00:12:07
    5. Creating our image helper library 00:16:56
    6. Creating our image schema 00:06:37
    7. Creating our image upload resource 00:09:11
    8. Trying out our image upload 00:08:23
    9. Retrieving and deleting images 00:09:59
    10. Another example: user avatars 00:10:58
    11. Adding the avatar resource 00:05:47
    12. Conclusion of this section 00:01:10
  7. Chapter 7 : Database migrations
    1. Introduction to this section 00:01:17
    2. What's in our starter code? 00:01:28
    3. Connecting to our remote database 00:03:11
    4. Initialising Flask-Migrate and Alembic 00:06:33
    5. Creating our initial table structure 00:08:06
    6. Our first database migration 00:03:05
    7. Checking the Alembic script (important!) 00:06:21
    8. Adding a new column with migrations 00:02:01
    9. Problems that can happen while migrating 00:05:35
    10. A word of caution! 00:01:46
    11. Defining a SQLAlchemy naming convention 00:06:23
    12. When should you read documentation? 00:05:07
    13. Conclusion of this section 00:01:03
  8. Chapter 8 : Third party login with OAuth
    1. Introduction to this lecture 00:00:59
    2. Introduction to OAuth 2.0 00:09:58
    3. What's in our starter code? 00:03:34
    4. Creating a GitHub OAuth App 00:03:57
    5. Flask-OAuthlib 00:04:14
    6. Setting up our GitHub client 00:07:50
    7. Our GithubLogin resource 00:05:30
    8. What is Flask's g? 00:05:46
    9. What is a tokengetter? 00:10:46
    10. Finishing our GithubAuthorize resource 00:05:43
    11. Adding some error handling 00:02:14
    12. Setting user passwords 00:08:42
    13. Using url_for with Flask-RESTful 00:02:59
    14. Conclusion of this section 00:01:08
  9. Chapter 9 : Payments with Stripe
    1. Introduction to this section 00:00:35
    2. Setting up our Stripe account 00:06:01
    3. What's in our starter code? 00:04:29
    4. Where do users pay? 00:06:43
    5. After payment: receiving order data 00:12:25
    6. Creating our OrderModel 00:11:13
    7. Many-to-many relationships with SQLAlchemy 00:10:26
    8. Using the Association Object in our Resource 00:16:36
    9. Charging orders with Stripe 00:10:30
    10. Calculating the amount and description 00:06:45
    11. Testing our OrderResource 00:04:12
    12. Creating a way to view existing orders 00:02:41
    13. When things go wrong: error handling in Stripe 00:04:26
    14. Security considerations in payments 00:03:12
    15. Conclusion of this section 00:01:07
  10. Chapter 10 : Bonus section
    1. Conclusion of the course 00:00:28

Product information

  • Title: Advanced REST APIs with Flask and Python
  • Author(s): Jose Salvatierra
  • Release date: August 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781839215810