Skill area · Web Development & APIs
Build for the web with Python and AI
From your first route to a deployed app and API
Real Python takes you from HTML basics and HTTP requests to full web apps with Django and Flask and fast, typed APIs with FastAPI. Follow a guided path, write real endpoints in your browser, and get help the moment you’re stuck.
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Shape(BaseModel):
name: str
no_of_sides: int
id: int
@app.get("/shapes")
def list_shapes() -> list[Shape]:
return shapes # validated and sent as JSON
curl localhost:8000/shapes
[
{"name": "Square", "no_of_sides": 4, "id": 1},
{"name": "Triangle", "no_of_sides": 3, "id": 2}
]
curl localhost:8000/shapes/2 # Next: one shape
Web Development & APIs on Real Python
- 80+web and API tutorials
- 40+video courses
- 35+interactive quizzes
- 70+coding exercises
- 5guided learning paths
What you’ll be able to do
Everything between a browser and your Python code
Whether you’re building a portfolio site, an internal tool, or a public API, the same building blocks show up. Real Python covers each one with hands-on projects.
Speak the web’s language
Learn how HTML, CSS, HTTP, and JSON fit together, and call other people’s APIs from Python.
Build web apps
Create sites with routes, templates, forms, and user accounts, from small Flask projects to full Django apps.
Design APIs
Build REST APIs with typed request and response models, automatic validation, and interactive docs.
Store data and ship it
Connect a database, move slow work to background tasks, and deploy your app behind a production web server.
Your roadmap
A clear path from first page to production app
Start with the web developer path to learn the foundations and try all three major frameworks. Then go deep on the one that fits your project. Each path mixes tutorials, video courses, quizzes, and exercises, and tracks your progress as you go.
- 1
Start here
Start with HTML and CSS, then build hands-on projects with FastAPI, Django, and Flask, create and consume REST APIs, and connect a JavaScript front end.
Learning Path
Become a Python Web Developer
22 Resources ⋅ Skills: Web Development, Django, Flask, FastAPI, REST APIs
- 2
Pick your framework
Build REST APIs with Pydantic models, serve web pages with Jinja2 templates, and finish with a complete URL shortener project.
Learning Path
FastAPI: Python API Development With Light Speed
7 Resources ⋅ Skills: FastAPI, REST APIs, Web Development, Jinja2, Pydantic
- 2
Pick your framework
Go from project setup to REST APIs, covering models and migrations, the admin, user management, and advanced patterns.
Learning Path
Django for Web Development
17 Resources ⋅ Skills: Django, Web Development, REST APIs, Migrations, User Management, Admin
- 2
Pick your framework
Build Flask apps from your first project to deployment, with Jinja templates, databases, REST APIs, and JavaScript front ends.
Learning Path
Flask by Example
12 Resources ⋅ Skills: Web Development, Flask Framework, Jinja, REST APIs, Databases, JavaScript Front Ends, Deployment
- +
Take it anytime
Work with the web from the other side: send HTTP requests, parse pages with Beautiful Soup and Scrapy, and automate browsers with Selenium.
Learning Path
Python Web Scraping
11 Resources ⋅ Skills: Web Scraping, HTTP Requests, Data Parsing, Browser Automation
New to Python itself? Start with Python Basics first.
Try it now
Serve a shape from a GET endpoint
This is a real exercise from the Python REST APIs With FastAPI video course, picking up where the code above leaves off. Add the route in the editor and click Run Tests.
Running tests, hints, and solutions are included with a Real Python membership. Not a member yet? You can still read the task and write your solution before you join.
Learn it every way
Read it, watch it, test it, practice it
Every web development topic comes in the formats that help it stick. Mix them however you like.
Tutorials
In-depth, project-based guides to Django, Flask, FastAPI, REST APIs, and the web fundamentals behind them.
Browse tutorials →Video courses
Follow along as an instructor builds a real app or API, one bite-sized lesson at a time.
Start Building With FastAPI →Quizzes
Check what you’ve learned in a few minutes and see exactly which concepts to review.
Test your web dev skills →Coding exercises
Write real FastAPI, Flask, and Django code in your browser and get instant test feedback.
How exercises work →Mentor AI
Endpoint returning the wrong thing? Ask right where you are
Web code fails in ways that are hard to see: a 422 you didn’t expect, a route that never matches, a 200 with null when you wanted a 404.
Mentor AI sees the tutorial, lesson, or exercise you’re on and your code, and nudges you toward the fix one hint at a time, so you understand what your framework is actually doing.
My test for GET /shapes/99 expects a 404, but I get a 200 with null. Why?
Good news first: your lookup works for ids that exist. Now follow the code for id 99. What does your function return when the loop finishes without finding a match?
Nothing, so None. And that becomes null?
Exactly. FastAPI happily sends None as a successful response. How could you tell it this is an error instead? Take another look at what the starter code imports on its first line.
The Python web stack
Learn the tools web teams actually use
From the major frameworks to the libraries you’ll reach for in every project.
Fresh from the library
New and updated for 2026
The Real Python team keeps publishing and refreshing web development content, so what you learn matches the framework versions you’ll use at work.
- TutorialPrimer on Jinja Templating
- TutorialHow to Integrate OpenTelemetry With a FastAPI App
- TutorialDjango Tasks: Exploring the Built-in Tasks Framework
- QuizEnhance Your Flask Web Project With a Database
- CourseWorking With APIs in Python: Reading Public Data
- CourseStart Building With FastAPI
- TutorialHow to Create a Django Project
Questions and answers
You should be comfortable with Python basics like functions, dictionaries, and classes. If you’re not there yet, the Python Basics learning path gets you ready, and you can switch to web development as soon as you finish it.
It depends on what you’re building. Django gives you a complete toolkit with an ORM, admin, and user accounts built in. Flask starts small and lets you add only what you need. FastAPI is built for APIs, with type hints, validation, and docs out of the box. The Become a Python Web Developer path lets you try all three before you commit.
Not to get started. You can build complete web apps with Python, HTML, and CSS, and the HTML and CSS Foundations course covers the front-end basics. When you’re ready, the learning paths show you how to connect a JavaScript front end to a Python back end.
No. The coding exercises run your FastAPI, Flask, and Django code on Real Python’s servers and test it for you, right in the browser. When you want to put an app online, courses like Deploy a Django App With Gunicorn and Nginx walk you through it.
Every Real Python membership includes all video courses, quizzes, coding exercises, and learning paths for web development and every other topic, along with Mentor AI as it rolls out.
Start building for the web
Get your free learning plan and follow the full web development roadmap, with courses, quizzes, coding exercises, and a mentor at your side.