💡 A full course to teach you how to use Flask and Python to make REST APIs using multiple Flask extensions and PostgreSQL.
Enrol in the course by going to this link.
Then you can come back here to download the repository. This repository contains the code that we develop in each section of the course.
If you are familiar with Git, you can use Git to download it. Otherwise, you can download it as a zip file:
Next, start taking the course at the beginning! You can use the downloaded code files to support you while you go through the course.
I also strongly recommend you code while you take the course. A good strategy is:
- Watch the video intently, optionally while taking notes.
- Watch again, more quickly, while typing the code together with me.
- Once you're done with the video, play about with the code. Make changes, break things, then fix them, and try to thoroughly understand everything the code does.
If you do this for the entire course, I guarantee you will learn how to make REST APIs using Flask and Python well and quickly. You'll still be using Google and searching for stuff every day, but so does everyone else!
The code is in files numbered between 1 and 11, covering concepts ranging from beginner to advanced.
- Variables
- Methods
- Lists, tuples, and sets
- If statements
- List comprehension
- Dictionaries
- Classes and objects
- Static and class methods
- Args and Kwargs
- Passing functions as arguments
- Decorators
The code in this section includes a simple Flask app and a HTML and JavaScript file which calls the Flask app endpoints.
The code in this section includes a Flask app which is an API that represents items. It also includes user registration and authentication.
We also introduce Flask-RESTful, which is a Flask extension that helps us develop APIs more easily.
The code in this section extends the last section by adding persistent storage of Items to a SQLite database.
The code in this section extends the previous section by replacing the manual integration with SQLite, with SQLAlchemy—an ORM (Object-Relational Mapping)—which allows us to easily replace SQLite with something like PostgreSQL or MySQL.
In this section we introduce Git, a tool for code sharing and collaboration. In this course we'll use it to store the application code and then send it to our deployment tools, Heroku and DigitalOcean.
Learn how to use GitHub and Heroku to deploy your Flask applications and make them available publicly to your users.
Learn how to rent a server using DigitalOcean and run our Flask app in it. This is an alternative to Heroku. It's much cheaper, but requires a lot more work to get it set up.
In this section we learn about https and how to enable it in your own server running with DigitalOcean.
Learn about token freshness and how to implement refresh tokens using Flask-JWT-Extended.