Description
In this course, you will learn :
- Connect web or mobile applications to databases and servers via REST APIs.
- Create secure and reliable REST APIs which include authentication, logging, caching, and more.
- Understand the different layers of a web server and how web applications interact with each other.
- Handle seamless user authentication with advanced features like token refresh.
- Handle log-outs and prevent abuse in your REST APIs with JWT blacklisting.
- Develop professional-grade REST APIs with expert instruction.
Syllabus :
1. A Full Python Refresher
- Access the code for this section here
- Variables in Python
- Solution to coding exercise: Variables
- 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
- 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
- @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)
2. Your first REST API
- What is an API?
- Installing Flask
- Access the code for this section here
- Your first Flask application
- HTTP Verbs
- REST Principles
- Creating our application endpoints
- Returning a list of stores
- Implementing other endpoints
- Calling the API from JavaScript
- Using Postman for API testing
3. Flask-RESTful for more efficient development
- Virtualenvs and setting up Flask-RESTful
- Access the code for this section here
- Your first Flask-RESTful app
- Test-first API design—what is that?
- Creating our Item Resource
- The ItemList and creating Items
- Improving code and error control
- Problem with Flask-JWT and Python 3.10
- An update to the next lecture content
- Authentication and logging in
- DELETE to delete Items
- PUT to create or update Items
- Advanced request parsing with Flask-RESTful
- Optimising our final code and request parsing
4. Storing resources in a SQL database
- Access the code for this section here
- Running a 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 users up
- Retrieving our Item resources from a database
- Writing our Item resources to a database
- Deleting our Item resources from the database
- Refactoring insertion of items
- The PUT method with database interaction
- Retrieving many items from the database
- Advanced Flask-JWT Configuration
5. Simplifying storage with Flask-SQLAlchemy
- Access the code for this section here
- Setting up this section's project
- Improving the project structure and maintainability
- Creating User and Item models
- Verifying the app works after our changes
- Advanced Postman: environments and tests
- Errata: small mistake in code in the next video
- Telling SQLAlchemy about our tables and columns
- Implementing the ItemModel using SQLAlchemy
- Implementing the UserModel using SQLAlchemy
- Easily displaying the ItemList resource with SQLAlchemy
- No more creating tables manually—telling SQLAlchemy to create tables
- Creating a new model: StoreModel
- Creating the Store Resource
- Final testing of this section's API
6. Git—version control
- Installing Git on Mac and Windows
- What is a Git repository?
- The Git workflow—part 1
- The Git workflow—part 2, including GitHub
- Using SSH keys for security
- The README file
7. Deploying Flask apps to Heroku
- Access the code for this section here
- What is Heroku?
- Getting our code into GitHub
- Setting up Heroku for Flask
- Adding the required files to the project
- Logs in Heroku and troubleshooting errors
- Testing the deployed API with Postman
- A small change needed in the next lecture
- Adding PostgreSQL to our Heroku app
- Working with Git and automatic deploys
8. Deploying Flask apps to our own server
- Setting up a DigitalOcean server
- Want to deploy to AWS?
- Installing PostgreSQL in Ubuntu 16.04
- Creating a UNIX user in Ubuntu 16.04
- Setting up our new user with PostgreSQL permissions
- Setting up nginx and our REST API
- Setting up uWSGI to run our REST API
- Testing our API to make sure everything works
9. Security in your REST APIs
- Security in REST APIs e-book
- Getting our domain name
- Setting up Cloudflare
- What is DNS?
- Setting our DNS records
- Verifying everything works—this is important!
- Creating our SSL certificate in Cloudflare
- Configuring nginx for SSL
- Extra technical SSL resources
10. Token refreshing and Flask-JWT-Extended
- Recent changes to Flask-JWT-Extended
- A recap of the code + a few changes!
- Creating a User Resource for testing
- Testing our 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 our REST API
- Requiring a fresh token in an endpoint
- Customizing Flask-JWT-Extended callbacks and responses
- Blacklisting with Flask-JWT-Extended
- Logging users out in our REST API
- E-book: complete review of the API so far
- Flask-JWT-Extended further reading