REST APIs with Flask and Python in 2024
Keep adding new skills with 10,000+ programs for $239 (usually $399). Save now.
REST APIs with Flask and Python in 2024
Included with
Learn more
Ask Coursera
11 reviews
Recommended experience
11 reviews
Recommended experience
What you'll learn
Develop REST APIs with Flask and Python
Implement CRUD operations using SQLAlchemy
User authentication with Flask-JWT-Extended
Deploy applications using Docker and Render.com
Skills you'll gain
Details to know
6 assignments
See how employees at top companies are mastering in-demand skills
There are 12 modules in this course
This course features Coursera Coach!
A smarter way to learn with interactive, real-time conversations that help you test your knowledge, challenge assumptions, and deepen your understanding as you progress through the course. In this comprehensive course, you will master the art of building REST APIs using Flask and Python. You will start by refreshing your Python fundamentals, focusing on key concepts like data structures, functions, and object-oriented programming. With this foundation, you'll quickly dive into the world of Flask, learning how to create REST API endpoints, handle data, and manage databases using SQLAlchemy. As you progress, youβll discover advanced techniques such as Docker containerization, API testing with Insomnia, and securing your APIs with JWT authentication. The course also includes hands-on projects, such as building a fully functional REST API that connects to a PostgreSQL database, and deploying it on Render.com for real-world application. Ideal for Python developers looking to expand their skills in web development, this course covers everything from simple API setup to advanced features like background task queues and email notifications. By the end of the course, youβll be able to confidently build and deploy modern REST APIs using Flask, and manage them effectively with industry-standard tools.
In this module, we will present the highlights and benefits of mastering REST APIs with Flask and Python. You'll gain insights into the significance of this skill set for your professional growth and be encouraged to dive into the learning experience.
What's included
1 video1 reading
1 videoβ’Total 2 minutes
- Promotionβ’2 minutes
1 readingβ’Total 10 minutes
- Full Course Resourcesβ’10 minutes
In this module, we will comprehensively review essential Python programming concepts, covering variables, data structures, control flow, functions, object-oriented programming, and more. This section will reinforce your Python knowledge and prepare you for advanced applications in API development.
What's included
47 videos
47 videosβ’Total 314 minutes
- Introduction to this sectionβ’1 minute
- Variables in Pythonβ’8 minutes
- Solution to coding exercise: Variablesβ’2 minutes
- String formatting in Pythonβ’6 minutes
- Getting user inputβ’5 minutes
- Writing our first Python appβ’3 minutes
- Lists, tuples, and setsβ’7 minutes
- Advanced set operationsβ’5 minutes
- Solution to coding exercise: Lists, tuples, setsβ’5 minutes
- Booleans in Pythonβ’5 minutes
- If statementsβ’8 minutes
- The 'in' keyword in Pythonβ’2 minutes
- If statements with the 'in' keywordβ’8 minutes
- Loops in Pythonβ’11 minutes
- Solution to coding exercise: Flow controlβ’3 minutes
- List comprehensions in Pythonβ’7 minutes
- Dictionariesβ’9 minutes
- Destructuring variablesβ’8 minutes
- Functions in Pythonβ’11 minutes
- Function arguments and parametersβ’8 minutes
- Default parameter valuesβ’4 minutes
- Functions Returning Valuesβ’7 minutes
- Solution to Coding Exercise: Functionsβ’3 minutes
- Lambda Functions in Pythonβ’8 minutes
- Dictionary Comprehensionsβ’4 minutes
- Solution to Coding Exercise: Dictionaries and Studentsβ’6 minutes
- Unpacking Argumentsβ’10 minutes
- Unpacking Keyword Argumentsβ’9 minutes
- Object-Oriented Programming in Pythonβ’16 minutes
- Magic Methods: ..str.. and ..repr..β’6 minutes
- Solution to Coding Exercise: Classes and Objectsβ’5 minutes
- @classmethod and @staticmethodβ’14 minutes
- Solution to Coding Exercise: @classmethod and @staticmethodβ’6 minutes
- Class Inheritanceβ’9 minutes
- Class Compositionβ’6 minutes
- Type Hinting in Python 3.5+β’5 minutes
- Imports in Pythonβ’10 minutes
- Relative Imports in Pythonβ’9 minutes
- Errors in Pythonβ’13 minutes
- Custom Error Classesβ’5 minutes
- First-Class Functionsβ’8 minutes
- Simple Decorators in Pythonβ’7 minutes
- The "at" Syntax for Decoratorsβ’4 minutes
- Decorating Functions with Parametersβ’2 minutes
- Decorators with Parametersβ’5 minutes
- Mutability in Pythonβ’6 minutes
- Mutable Default Parameters (and Why They Are a Bad Idea)β’4 minutes
In this module, we will guide you through building your first REST API using Flask. You'll learn to set up the Flask app, create endpoints, and interact with the API using JSON, laying the groundwork for more complex projects.
What's included
8 videos1 assignment
8 videosβ’Total 39 minutes
- Overview of the project we'll buildβ’4 minutes
- Initial set-up for a Flask appβ’5 minutes
- Your first REST API endpointβ’4 minutes
- What is JSON?β’4 minutes
- How to interact with and test your REST APIβ’4 minutes
- How to create stores in our REST APIβ’6 minutes
- How to create items in each storeβ’8 minutes
- How to get a specific store and its itemsβ’5 minutes
1 assignmentβ’Total 15 minutes
- Assessment 1β’15 minutes
In this module, we will introduce Docker and demonstrate how to containerize your Flask application. You will learn to use Docker and Docker Compose to streamline development and deployment processes.
What's included
3 videos
3 videosβ’Total 30 minutes
- What are Docker containers and images?β’13 minutes
- How to run a Flask app in a Docker containerβ’11 minutes
- How to run the Flask REST API with Docker Composeβ’5 minutes
In this module, we will explore the Flask-Smorest extension to improve your API development process. You'll learn to enhance data models, create new endpoints, and use Flask-Smorest for decorating responses and validating data.
What's included
8 videos
8 videosβ’Total 62 minutes
- Data model improvements for our APIβ’16 minutes
- General improvements to our first REST APIβ’7 minutes
- New endpoints for our first REST APIβ’9 minutes
- How to run the API in Docker with automatic reloading and debug modeβ’6 minutes
- How to use Blueprints and MethodViews in Flaskβ’10 minutes
- How to write marshmallow schemas for our APIβ’4 minutes
- How to perform data validation with marshmallowβ’5 minutes
- Decorating responses with Flask-Smorestβ’5 minutes
In this module, we will cover integrating SQLAlchemy with Flask for robust database management. You'll learn to create and manage database models, handle relationships, and perform CRUD operations efficiently.
What's included
11 videos1 assignment
11 videosβ’Total 50 minutes
- Overview and why use SQLAlchemyβ’2 minutes
- How to code a simple SQLAlchemy modelβ’5 minutes
- How to write one-to-many relationships using SQLAlchemyβ’10 minutes
- How to configure Flask-SQLAlchemy with your Flask appβ’8 minutes
- How to insert data into a table using SQLAlchemyβ’7 minutes
- How to find models in the database by ID or return a 404β’4 minutes
- How to update models with SQLAlchemyβ’5 minutes
- How to retrieve list of all modelsβ’1 minute
- How to delete models with SQLAlchemyβ’1 minute
- Deleting related models with cascadesβ’4 minutes
- Conclusion of this sectionβ’4 minutes
1 assignmentβ’Total 15 minutes
- Assessment 2β’15 minutes
In this module, we will delve into complex data relationships using SQLAlchemy. You will learn to implement one-to-many and many-to-many relationships, optimizing your database models for real-world scenarios.
What's included
3 videos
3 videosβ’Total 25 minutes
- Changes in this sectionβ’3 minutes
- One-to-many relationship between stores and tagsβ’11 minutes
- Many-to-many relationship between items and tagsβ’11 minutes
In this module, we will explore user authentication with Flask-JWT-Extended. You will learn to integrate JWT-based authentication, create registration and login endpoints, and secure your API endpoints effectively.
What's included
10 videos
10 videosβ’Total 67 minutes
- Who uses the JWT?β’10 minutes
- How to set up Flask-JWT-Extended with our appβ’4 minutes
- Coding the User model and schemaβ’2 minutes
- How to add a register endpoint to the REST APIβ’10 minutes
- How to add a login endpoint to the REST APIβ’9 minutes
- Protect endpoints by requiring a JWTβ’6 minutes
- JWT claims and authorizationβ’6 minutes
- How to add logout to the REST APIβ’6 minutes
- Request chaining with Insomniaβ’5 minutes
- Token refreshing with Flask-JWT-Extendedβ’9 minutes
In this module, we will introduce Alembic and Flask-Migrate for handling database migrations. You will learn to set up, initialize, and manage database schemas, ensuring smooth transitions during development.
What's included
4 videos1 assignment
4 videosβ’Total 16 minutes
- How to add Flask-Migrate to our Flask appβ’2 minutes
- Initialize your database with Flask-Migrateβ’6 minutes
- Change SQLAlchemy models and generate a migrationβ’5 minutes
- Manually review and modify database migrationsβ’3 minutes
1 assignmentβ’Total 15 minutes
- Assessment 3β’15 minutes
In this module, we will provide a crash course on Git, covering the basics of version control, branching, merging, and resolving conflicts. You will learn to manage your code efficiently and collaborate effectively using Git.
What's included
7 videos
7 videosβ’Total 40 minutes
- What are Git repositories and commits?β’10 minutes
- Initialize a Git repository for our projectβ’8 minutes
- Writing Markdown for documents and commitsβ’3 minutes
- Remote repositories and how to use themβ’5 minutes
- Git branches and mergingβ’6 minutes
- Merge conflicts and how to resolve themβ’5 minutes
- Overview of the final e-book chaptersβ’2 minutes
In this module, we will guide you through deploying your Flask applications on Render.com. You will learn to set up web services, manage PostgreSQL databases, and test your applications to ensure stability in production.
What's included
6 videos
6 videosβ’Total 41 minutes
- Creating a Render.com web serviceβ’6 minutes
- How to run Flask with gunicorn in Dockerβ’6 minutes
- Get a deployed PostgreSQL databaseβ’2 minutes
- Run the app and database locally with Docker Composeβ’17 minutes
- Use PostgreSQL locally and in productionβ’2 minutes
- Test the finished production appβ’9 minutes
In this module, we will cover task queues and background task management using rq. You will learn to send emails with Mailgun, manage task queues, and deploy background task workers, enhancing the functionality and reliability of your Flask applications.
What's included
7 videos3 assignments
7 videosβ’Total 47 minutes
- How to send emails with Python and Mailgunβ’5 minutes
- How to send emails when users registerβ’10 minutes
- What is a task queue and setting up a Redis databaseβ’5 minutes
- How to Populate and consume the task queue with rqβ’6 minutes
- How to process background tasks with the rq workerβ’5 minutes
- How to send HTML emails using Mailgun and Pythonβ’10 minutes
- How to deploy a background worker to render.comβ’6 minutes
3 assignmentsβ’Total 90 minutes
- Full Course Practice Assessmentβ’15 minutes
- Assessment 4β’15 minutes
- Full Course Assessmentβ’60 minutes
Instructor
Offered by
Explore more from Mobile and Web Development
Course
- Status: Free Trial
Course
- Status: Free Trial
- Status: Free Trial
Why people choose Coursera for their career
Frequently asked questions
Yes, you can preview the first video and view the syllabus before you enroll. You must purchase the course to access content not included in the preview.
If you decide to enroll in the course before the session start date, you will have access to all of the lecture videos and readings for the course. Youβll be able to submit assignments once the session starts.
Once you enroll and your session begins, you will have access to all videos and other resources, including reading items and the course discussion forum. Youβll be able to view and submit practice assessments, and complete required graded assignments to earn a grade and a Course Certificate.
More questions
Financial aid available,
