O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

REST APIs with Flask and Python

Video Description

Build professional REST APIs with Python, Flask, Flask-RESTful, and Flask-SQLAlchemy

About This Video

  • Create resource-based, production-ready REST APIs using Flask and popular extensions
  • Using SQLAlchemy to easily and efficiently store resources to a database
  • Understand the complex intricacies of deployments and performance of REST APIs

In Detail

Are you tired of boring, outdated, incomplete, or incorrect tutorials? I say no more to copy-pasting code that you don’t understand. Welcome to one of the best resources online on creating REST APIs. I'm Jose, and I'm a software engineer; here to help you truly understand and develop your skills in web and REST API development with Python. Production-ready REST APIs. This course will guide you in creating simple, intermediate, and advanced REST APIs including authentication, deployments, caching, and much more. We'll start with a Python refresher that will take you from the very basics to some of the most advanced features of Python—for you to never be lost or confused. Using Flask and popular extensions Flask-RESTful, Flask-JWT, and Flask-SQLAlchemy we will dive right into developing complete, solid, production-ready REST APIs. We will also look into essential technologies Git, Heroku, nginx, and Varnish. I pride myself in providing excellent support and feedback to every single student. I am always available to guide you personally, and answer questions for your benefit.Don't wait, and sign up today to take another step toward web services mastery!I'll see you on the inside.

Table of Contents

  1. Chapter 1 : Welcome!
    1. Welcome to the course 00:01:25
  2. Chapter 2 : A Full Python Refresher
    1. Introduction to this section 00:01:05
    2. Variables in Python 00:06:23
    3. Solution to coding exercise: Variables 00:02:00
    4. Methods in Python 00:13:00
    5. Solution to coding exercise: Methods 00:03:33
    6. Lists, tuples, and sets 00:07:52
    7. List, tuple, and set operations 00:08:41
    8. Advanced set operations 00:06:24
    9. Solution to coding exercise: Lists, tuples, sets 00:04:40
    10. Loops in Python 00:14:02
    11. If statements 00:07:37
    12. Solution to coding exercise: Flow control 00:05:26
    13. A programming exercise for you 00:10:44
    14. List comprehension 00:13:27
    15. Dictionaries 00:07:04
    16. Are dictionaries "things"? 00:04:30
    17. Solution to coding exercise: Dictionaries 00:06:16
    18. Objects in Python 00:11:08
    19. A Student example 00:05:16
    20. Solution to coding exercise: Classes and objects 00:05:05
    21. @classmethod and @staticmethod 00:07:44
    22. Solution to coding exercise: @classmethod and @staticmethod 00:05:54
    23. Inheritance in Object-Oriented Programming 00:12:44
    24. *args and **kwargs 00:11:20
    25. Passing functions as arguments 00:09:08
    26. Decorators in Python 00:06:52
    27. Advanced decorators 00:08:18
    28. Conclusion of this section 00:00:34
  3. Chapter 3 : Your first REST API
    1. Introduction to this section 00:01:03
    2. Installing Flask 00:01:59
    3. Your first Flask application 00:09:55
    4. HTTP Verbs 00:10:03
    5. REST Principles 00:07:42
    6. Creating our application endpoints 00:08:26
    7. Returning a list of stores 00:07:01
    8. Implementing other endpoints 00:08:49
    9. Calling the API from JavaScript 00:06:40
    10. Using Postman for API testing 00:12:08
    11. Conclusion of this section 00:00:51
  4. Chapter 4 : Flask-RESTful for more efficient development
    1. Welcome to this section 00:00:30
    2. Virtualenvs and setting up Flask-RESTful 00:08:05
    3. Your first Flask-RESTful app 00:10:39
    4. Test-first API design—what is that? 00:10:49
    5. Creating our Item Resource 00:10:33
    6. The ItemList and creating Items 00:07:16
    7. Improving code and error control 00:07:16
    8. Authentication and logging in—part 1 00:12:18
    9. Authentication and logging in—part 2 00:07:18
    10. DELETE to delete Items 00:04:34
    11. PUT to create or update Items 00:04:27
    12. Advanced request parsing with Flask-RESTful 00:06:16
    13. Optimising our final code and request parsing 00:03:53
    14. Conclusion of this section 00:00:38
  5. Chapter 5 : Storing resources in a SQL database
    1. Welcome to this section 00:00:51
    2. Setting up our project 00:03:36
    3. Running a SQLite database and interacting with it from Python 00:13:16
    4. Logging in and retrieving Users from a database 00:16:42
    5. Signing up and writing Users to a database 00:13:32
    6. Preventing duplicate usernames when signing users up 00:02:57
    7. Retrieving our Item resources from a database 00:09:00
    8. Writing our Item resources to a database 00:13:18
    9. Deleting our Item resources from the database 00:04:02
    10. Refactoring insertion of items 00:05:01
    11. The PUT method with database interaction 00:05:00
    12. Retrieving many items from the database 00:06:42
    13. Conclusion of this section 00:00:32
  6. Chapter 6 : Simplifying storage with Flask-SQLAlchemy
    1. Welcome to this section! 00:00:44
    2. Setting up this section's project 00:06:09
    3. Improving the project structure and maintainability 00:04:59
    4. Creating User and Item models 00:23:05
    5. Verifying the app works after our changes 00:05:19
    6. Advanced Postman: environments and tests 00:11:17
    7. Telling SQLAlchemy about our tables and columns 00:10:45
    8. Implementing the ItemModel using SQLAlchemy 00:15:17
    9. Implementing the UserModel using SQLAlchemy 00:09:42
    10. Easily displaying the ItemList resource with SQLAlchemy 00:05:08
    11. No more creating tables manually—telling SQLAlchemy to create tables 00:02:40
    12. Creating a new model: StoreModel 00:12:33
    13. Creating the Store Resource 00:09:46
    14. Final testing of this section's API 00:05:59
    15. Conclusion of this section 00:00:57
  7. Chapter 7 : Git—version control
    1. Welcome to this section 00:01:33
    2. Installing Git on Mac and Windows 00:04:12
    3. What is a Git repository? 00:05:28
    4. The Git workflow—part 1 00:04:31
    5. The Git workflow—part 2, including GitHub 00:05:18
    6. Using SSH keys for security 00:06:53
    7. The README file 00:05:26
    8. Conclusion of this section 00:00:38
  8. Chapter 8 : Deploying Flask apps to Heroku
    1. Welcome to this section 00:01:01
    2. What is Heroku? 00:06:33
    3. Getting our code into GitHub 00:07:48
    4. Setting up Heroku for Flask 00:04:29
    5. Adding the required files to the project 00:10:50
    6. Logs in Heroku and troubleshooting errors 00:09:01
    7. Testing the deployed API with Postman 00:03:56
    8. Adding PostgreSQL to our Heroku app 00:09:20
    9. Working with Git and automatic deploys 00:06:31
    10. Conclusion of this section 00:00:49
  9. Chapter 9 : Deploying Flask apps to our own server
    1. Welcome to this section 00:00:37
    2. Setting up a DigitalOcean server 00:11:58
    3. Installing PostgreSQL in Ubuntu 16.04 00:08:09
    4. Creating a UNIX user in Ubuntu 16.04 00:07:45
    5. Setting up our new user with PostgreSQL permissions 00:09:06
    6. Setting up nginx and our REST API 00:19:35
    7. Setting up uWSGI to run our REST API 00:24:04
    8. Testing our API to make sure everything works 00:07:21
    9. Conclusion of this section 00:01:22
  10. Chapter 10 : Security in your REST APIs
    1. Getting our domain name 00:06:14
    2. Setting up Cloudflare 00:08:26
    3. What is DNS? 00:05:04
    4. Setting our DNS records 00:07:38
    5. Verifying everything works—this is important! 00:01:27
    6. Creating our SSL certificate in Cloudflare 00:02:42
    7. Configuring nginx for SSL 00:12:00