Advanced REST APIs with Flask and Python

Advanced REST APIs with Flask and Python

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 12.5 Hours | 6.01 GB

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

Welcome to our Advanced REST API Course!

We created the most popular introductory REST API development course on Udemy, with over 4,000 reviews and 20,000 students. Now we want to help you get even farther with this Advanced REST API course, of course still using Flask and Python.

Our first course took you from zero to a deployed REST API that users could access. In this one we will cover a whole bunch of topics students have been requesting for months!

Topics covered

  • Use Marshmallow for data serialization and deserialization
  • Send e-mails and user confirmations
  • Upload images
  • Database migrations
  • Easy ways of writing documentation and testing your API
  • Handle payments using Stripe
  • Third party login using OAuth (GitHub is used as the example)
  • Extensive software development knowledge, refactoring, debugging, and more!
  • Use the latest technologies and the best practices. We teach everything using Python 3.7, the latest version.

Course structure

We’ll start with a simple REST API and teach you everything you need to know about it—so even if you’ve not taken our first course, you can follow along with absolutely no issues. We’ve even written an e-book to get you up to speed quickly with this starter REST API!

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’ll also help you understand more about how to build features incrementally to get them to your users quickly and minimise risk!

Extra resources

Many lectures contain extra resources, such as links to external documentation and projects, for you to go and learn more. And for each lecture, we include the source code at the start and at the end so you’ll never be lost. All source code is provided as downloadable and also in GitHub for your convenience.

We’re always available to help in the Udemy Course Q&A and also our own student community Slack channel. Make use of these awesome resources!

Advanced course

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

You should have 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 PyCharm for debugging is also a plus, although we will cover using the debugger in the course!

What you’ll learn

  • Integrate advanced functionality in your API such as image upload, payments, or user confirmation e-mails!
  • Bring your REST API development to a whole new level by getting familiar with more of the Flask ecosystem
  • Improve operations of existing REST APIs with database migrations and extensive refactoring knowledge
  • Easily deploy documentation pages and test your API with Postman’s collection runner
Table of Contents

Introduction
1 Why you should take this course!
2 things you should know before starting this course
3 Introduction to this section
4 Access the e-book for Section 1 here!
5 Our project and endpoints
6 Reviewing the beginner course code
7 Simplifying our error handling
8 Refactoring our resources
9 Should we have unique names
10 Adding basic type hinting
11 Adding custom JSON types
12 Using the current class as a type hint
13 Using Black for code formatting
14 Improving errors with constants
15 @classmethod across the board
16 Testing our API with Postman
17 Conclusion of this section

Serialization with Marshmallow
18 Introduction to this section
19 Serialization with Marshmallow
20 Deserialization with Marshmallow
21 Migrating from virtualenv to Pipenv
22 Postman collection for this section
23 Using vanilla Marshmallow with the API
24 A change to marshmallow-sqlalchemy
25 Introduction to Flask-Marshmallow
26 Adding items to our REST API
27 Adding stores to our REST API
28 Deduplicating error handling
29 Conclusion of this section

E-mail confirmations
30 Introduction to this section
31 Introduction to e-mail confirmation
32 Postman collection for this section
33 Adding an activated property
34 Activating users manually
35 Telling users they are active
36 Setting up Mailgun
37 Sending e-mails with Mailgun (Part 1)
38 Sending e-mails with Mailgun (Part 2)
39 Creating our Mailgun library file
40 Using .env files in Flask
41 Adding more configuration to .env
42 Error handling in Mailgun
43 Conclusion of this section

Advanced e-mail confirmation
44 Introduction to this section
45 Postman collection for this section
46 Creating the ConfirmationModel
47 Changes in our UserModel
48 Creating our ConfirmationResource
49 Updating our UserResource
50 Adding the last confirmation to the user schema
51 Fixing our app.py
52 Cross-resource dependencies are (generally) bad
53 What are localisation and internationalisation
54 Storing strings in config files
55 Creating a simple translation library
56 Updating our resources to use translations
57 Adding a new language to our API
58 What is Flask-Babel
59 Common pitfalls and advice
60 Conclusion of this section

Postman documentation and tests
61 Introduction to this section
62 Postman collection for this section
63 Collection and request descriptions
64 Recap of Postman environments
65 JavaScript tests in Postman
66 Running entire collections in Postman
67 Adding example requests and responses
68 Previewing our Postman documentation
69 Publishing our documentation page
70 More options for publishing documentation
71 Conclusion of this section

Image uploads
72 Introduction to this section
73 Postman collection for this section
74 Errata and code changes required
75 Installing Flask-Uploads
76 Config files in Flask
77 What are wsgi and Werkzeug
78 Creating our image helper library
79 Creating our image schema
80 Creating our image upload resource
81 Trying out our image upload
82 Retrieving and deleting images
83 Another example user avatars
84 Adding the avatar resource
85 Conclusion of this section

Database migrations
86 Introduction to this section
87 Getting a PostgreSQL database
88 What’s in our starter code
89 Postman collection for this section
90 Connecting to our remote database
91 Initialising Flask-Migrate and Alembic
92 Creating our initial table structure
93 Our first database migration
94 Checking the Alembic script (important!)
95 Adding a new column with migrations
96 Problems that can happen while migrating
97 A word of caution!
98 Defining a SQLAlchemy naming convention
99 When should you read documentation
100 Conclusion of this section

Third party login with OAuth
101 Introduction to this lecture
102 Introduction to OAuth 2.0
103 What’s in our starter code
104 Postman collection for this section
105 Creating a GitHub OAuth App
106 Flask-OAuthlib
107 Setting up our GitHub client
108 Our GithubLogin resource
109 What is Flask’s g
110 What is a tokengetter
111 Finishing our GithubAuthorize resource
112 Adding some error handling
113 Setting user passwords
114 Using url for with Flask-RESTful
115 Conclusion of this section

Payments with Stripe
116 Introduction to this section
117 Setting up our Stripe account
118 What’s in our starter code
119 Postman collection for this section
120 Where do users pay
121 After payment receiving order data
122 Creating our OrderModel
123 Many-to-many relationships with SQLAlchemy
124 Using the Association Object in our Resourcee
125 Charging orders with Stripe
126 Calculating the amount and description
127 Testing our OrderResource
128 Creating a way to view existing orders
129 When things go wrong error handling in Stripe
130 Security considerations in payments
131 Conclusion of this section

Bonus section
132 Conclusion of the course
133 Bonus lecture other courses and next steps