Video description
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!
What You Will Learn
- Use Marshmallow for data serialization and deserialization
- Send e-mails and user confirmations
- Upload images, Database migrations
- Easy ways to write documentation and test your API
- Handle payments using Stripe
- Third-party login using OAuth
- Master software development, refactoring, debugging, and more!
- Use the latest technologies and best practices.
Audience
This course is designed for software developers who want to add advanced functionality to REST APIs, backend developers interested in gaining knowledge of Flask and its ecosystem, and advanced developers of other programming languages who want to get up-to-speed quickly with advanced REST API development in Python
About The Author
Jos Salvatierra Fuentes: Jose Salvatierra has been teaching online for over seven years, and he loves helping students learn to code and master software development. He founded Teclado to bring software development to everyone; his objective is for you to truly understand everything that goes on behind the scenes.
Coding is extremely rewarding. As you learn, things start to click and make sense. You can join the dots of all the things that weren’t quite clear before.
Jose can help you with Python and JavaScript issues, particularly in web and backend development. He is experienced with programming libraries and frameworks such as Flask, React, React Native, and AngularJS. He has worked extensively with UNIX systems, MongoDB, PostgreSQL, and advanced system architecture design.
Table of contents
-
Chapter 1 : Introduction
- Introduction to this section
- Our project and endpoints
- Reviewing the beginner course code
- Simplifying our error handling
- Refactoring our resources
- Should we have unique names?
- Adding basic type hinting
- Adding custom JSON types
- Using the current class as a type hint
- Using Black for code formatting
- Improving errors with constants
- @classmethod across the board
- Testing our API with Postman
- Conclusion of this section
-
Chapter 2 : Serialization with Marshmallow
- Introduction to this section
- Serialization with Marshmallow
- Deserialization with Marshmallow
- Migrating from virtualenv to Pipenv
- Using vanilla Marshmallow with the API
- Introduction to Flask-Marshmallow
- Adding items to our REST API
- Adding stores to our REST API
- Deduplicating error handling
- Conclusion of this section
-
Chapter 3 : E-mail confirmations
- Introduction to this section
- Introduction to e-mail confirmation
- Adding an activated property
- Activating users manually
- Telling users, they are active
- Setting up Mailgun
- Sending e-mails with Mailgun (Part 1)
- Sending e-mails with Mailgun (Part 2)
- Creating our Mailgun library file
- Using .env files in Flask
- Adding more configuration to. Env
- Error handling in Mailgun
- Conclusion of this section
-
Chapter 4 : Advanced e-mail confirmation
- Introduction to this section
- Creating the Confirmation Model
- Changes in our User Model
- Creating our Confirmation Resource
- Updating our User Resource
- Adding the last confirmation to the user schema
- Fixing our app.py
- Cross-resource dependencies are (generally) bad
- What are localisation and internationalisation?
- Storing strings in config files
- Creating a simple translation library
- Updating our resources to use translations
- Adding a new language to our API
- What is Flask-Babel?
- Common pitfalls and advice
- Conclusion of this section
-
Chapter 5 : Postman documentation and tests
- Introduction to this section
- Collection and request descriptions
- Recap of Postman environments
- JavaScript tests in Postman
- Running entire collections in Postman
- Adding example requests and responses
- Previewing our Postman documentation
- Publishing our documentation page
- More options for publishing documentation
- Conclusion of this section
-
Chapter 6 : Image uploads
- Introduction to this section
- Installing Flask-Uploads
- Config files in Flask
- What are wsgi and Werkzeug?
- Creating our image helper library
- Creating our image schema
- Creating our image upload resource
- Trying out our image upload
- Retrieving and deleting images
- Another example: user avatars
- Adding the avatar resource
- Conclusion of this section
-
Chapter 7 : Database migrations
- Introduction to this section
- What's in our starter code?
- Connecting to our remote database
- Initialising Flask-Migrate and Alembic
- Creating our initial table structure
- Our first database migration
- Checking the Alembic script (important!)
- Adding a new column with migrations
- Problems that can happen while migrating
- A word of caution!
- Defining a SQLAlchemy naming convention
- When should you read documentation?
- Conclusion of this section
-
Chapter 8 : Third party login with OAuth
- Introduction to this lecture
- Introduction to OAuth 2.0
- What's in our starter code?
- Creating a GitHub OAuth App
- Flask-OAuthlib
- Setting up our GitHub client
- Our GithubLogin resource
- What is Flask's g?
- What is a tokengetter?
- Finishing our GithubAuthorize resource
- Adding some error handling
- Setting user passwords
- Using url_for with Flask-RESTful
- Conclusion of this section
-
Chapter 9 : Payments with Stripe
- Introduction to this section
- Setting up our Stripe account
- What's in our starter code?
- Where do users pay?
- After payment: receiving order data
- Creating our OrderModel
- Many-to-many relationships with SQLAlchemy
- Using the Association Object in our Resource
- Charging orders with Stripe
- Calculating the amount and description
- Testing our OrderResource
- Creating a way to view existing orders
- When things go wrong: error handling in Stripe
- Security considerations in payments
- Conclusion of this section
- Chapter 10 : Bonus section
Product information
- Title: Advanced REST APIs with Flask and Python
- Author(s):
- Release date: August 2019
- Publisher(s): Packt Publishing
- ISBN: 9781839215810
You might also like
video
REST APIs with Flask and Python in 2024
A REST API is an application that accepts data from clients and returns data back. For …
video
The Complete Python Course
With its increasing popularity in the last few years, the demand for Python skills in the …
video
Python A-Z: Learn Python by Building 15 Projects and ChatGPT
This comprehensive Python course covers all fundamental concepts and advanced Python concepts, and you learn a …
book
Python Testing with pytest
Test applications, packages, and libraries large and small with pytest, Python's most powerful testing framework. pytest …