Backend Web Development with Flask
Learn to build backend web applications with Python and Flask, starting with the fundamentals of HTTP, routes, and request handling. You’ll develop a REST API that supports creating, reading, updating, and deleting data, and learn to store that data in a database. As you progress, you’ll add authentication, handle file uploads safely, and document your API. By the end of the course, you’ll have built and documented a practical Flask API that you can extend for your own projects.
Last Cohort Discount
Offer ends in 28 days
Or pay in installments at checkout.
This course includes
Course Curriculum
6 modules · 59 lessons1Python Web Fundamentals and Flask Setup10 lessons
Explore how HTTP requests and responses work, set up a Python development environment, and create a basic Flask application. You’ll be able to run a Flask server and explain how a client communicates with it.
Understand How a Browser and Web Server Communicate
Describe the roles of a browser and a web server in a basic web interaction.
Trace an HTTP Request and Response
Trace how a browser request leads to a server response using a simple example.
Recognize GET and POST Requests
Distinguish GET requests from POST requests in common web interactions.
Interpret Common HTTP Status Codes
Identify what common success and error status codes communicate to a browser.
Install Python and Prepare a Coding Workspace
Install Python and Visual Studio Code for Flask development.
Create a Virtual Environment and Install Flask
Set up a project-specific Python environment and install Flask in it.
Build and Run Your First Flask Application
Create a Flask application and start its development server from the terminal.
Add Routes and Responses to a Flask App
Create multiple Flask routes that return clear text responses.
Test Flask Routes in a Browser
Verify Flask responses in a browser and connect each response to the request that triggered it.
Project: Build a Small Multi-Page Flask Website
Build and run a Flask website with multiple routes that return useful responses.
2Flask Routes, Requests, and JSON Responses10 lessons
Build routes that accept different HTTP methods, read request data, and return JSON with appropriate status codes. You’ll be able to design the basic endpoints of a REST API.
Set Up Python, Flask, and Your Development Environment
Install Python, VS Code, Flask, and a project virtual environment.
Create and Run a Minimal Flask Application
Run a Flask development server from a minimal application file.
Create a Route That Handles a GET Request
Define a URL route that responds to a browser request with text.
Choose an HTTP Method for a Request
Configure a Flask route to accept GET or POST requests.
Read Query Parameters from a Request
Retrieve and use query parameters sent in a URL.
Read JSON Data from a Request Body
Read JSON fields sent by a client in a POST request.
Return JSON from a Flask Route
Send a JSON response using Flask's jsonify function.
Set Appropriate HTTP Status Codes
Return suitable status codes for successful and unsuccessful requests.
Connect Resource URLs to CRUD Methods
Map GET, POST, PUT, and DELETE requests to resource routes with URL parameters.
Capstone Project: Build a Task Management API
Build and test a Flask task API with CRUD routes, JSON data, and appropriate status codes.
3CRUD APIs and Database Persistence10 lessons
Connect a Flask API to a database using SQLite and SQLAlchemy, and implement create, read, update, and delete operations. You’ll be able to persist and retrieve application data through API endpoints.
Set Up a Flask and SQLite Development Environment
Install Flask, Flask-SQLAlchemy, and a virtual environment, then run the starter Flask application.
Connect a Flask App to a SQLite Database
Configure Flask-SQLAlchemy to connect the application to a local SQLite database.
Define a Database Model
Create a SQLAlchemy model with columns and data types for one application resource.
Create and Inspect Database Tables
Create the model’s SQLite table and verify its columns using a database browser or command-line tool.
Create Records with a POST Endpoint
Implement a POST endpoint that validates JSON input and saves a new record to SQLite.
Read Records with GET Endpoints
Implement GET endpoints that return all records and one record by its ID.
Update Records with a PUT Endpoint
Implement a PUT endpoint that changes an existing record and saves the update to SQLite.
Delete Records with a DELETE Endpoint
Implement a DELETE endpoint that removes a record and returns a clear response when its ID does not exist.
Test CRUD Endpoints and Persistence
Use the Flask test client to verify CRUD responses and confirm that changes persist in SQLite.
Capstone Project: Build a Persistent Task API
Build a Flask task API with SQLite persistence and working create, read, update, and delete endpoints.
4Input Validation, Errors, and API Testing10 lessons
Validate incoming data, return clear error responses, and test API behavior with pytest. You’ll be able to check that successful requests and common failure cases behave as expected.
Set Up pytest for Flask API Testing
Configure pytest to run tests against the course Flask application.
Read JSON Data from a Flask Request
Read a JSON payload from an incoming Flask request.
Check Required Fields and Data Types
Reject request payloads that omit required fields or use incorrect data types.
Validate String Values
Enforce length and allowed-value rules for string fields.
Validate Numeric Values
Enforce minimum and maximum rules for numeric fields.
Return Clear Validation Errors
Return a JSON error message with an appropriate HTTP status code for invalid input.
Standardize Errors with Flask Error Handlers
Use a Flask error handler to return consistent JSON responses for common HTTP errors.
Test API Requests with the Flask Test Client
Write a pytest test that sends a request to a Flask endpoint and checks its response.
Test Successful and Invalid Requests
Write pytest cases that check successful responses and common validation failures.
Project: Build and Test a Validated Flask API Endpoint
Build a Flask API endpoint that validates incoming data and verify its success and error behavior with pytest.
5Authentication and Secure File Uploads10 lessons
Add user authentication with securely hashed passwords and protect selected API routes. You’ll also handle file uploads with checks for allowed file types and safe storage practices.
Set Up Authentication and Upload Dependencies
Install Flask-SQLAlchemy and Flask-JWT-Extended and configure them in the Flask application.
Create User Records with Hashed Passwords
Create a user model that stores password hashes instead of plain-text passwords.
Build a User Registration Endpoint
Implement an endpoint that validates registration data and saves a new user.
Build a Login Endpoint with Access Tokens
Implement an endpoint that verifies a password and returns an access token.
Protect API Routes with Access Tokens
Require a valid access token to use a selected API route.
Receive Files Through a Flask Endpoint
Create an upload endpoint that accepts multipart form data and enforces a file-size limit.
Validate Upload File Types
Reject uploaded files whose extensions are not on an allowed list.
Store Uploaded Files Safely
Save accepted files with safe, unique filenames in a controlled storage location.
Require Authentication for File Uploads
Restrict the upload endpoint to authenticated users and return safe file metadata.
Build an Authenticated File Upload API
Build and test a Flask API that registers users, issues access tokens, and securely stores authenticated users’ allowed file uploads.
6API Documentation and Capstone Application9 lessons
Document API endpoints, request formats, responses, and authentication requirements using the OpenAPI specification. You’ll bring together CRUD operations, authentication, and file uploads in a complete, documented Flask API.
Install Flask-Smorest and Configure the Documentation Environment
Install Flask-Smorest and Marshmallow in the project’s virtual environment and enable OpenAPI documentation.
Set OpenAPI Metadata and Find the Swagger UI
Add an API title, version, and description and open the generated Swagger UI page.
Document CRUD Routes with Paths and HTTP Methods
Describe each CRUD route using its URL path and HTTP method in the API documentation.
Describe Request Data with Schemas
Define schemas for JSON request bodies and path parameters used by the API.
Document Successful Responses and Errors
Specify response formats and status codes for successful requests and common errors.
Document Authentication Requirements
Describe the API’s bearer-token authentication scheme and mark protected routes as requiring authentication.
Document File Upload Requests
Describe a file-upload route using the multipart form format and document its response.
Explore and Test the API in Swagger UI
Use Swagger UI to inspect documented routes and send sample requests to the Flask API.
Capstone: Build and Document a Flask Resource API
Integrate CRUD operations, bearer-token authentication, and file uploads into a Flask API with complete OpenAPI documentation.
Course Details
- Level
- Beginner
- Duration
- 10 Weeks
- Modules
- 6
- Lectures
- 59
- Language
- English
- Certificate
- Included
- Last Updated
- 17 Oct 2026
What You Get
- Expert-led lectures
- AI-powered learning assistant
- Live classes with instructors
- Hands-on projects & assignments
- Certificate of completion
- 3 months free Community membership