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
- 80+web and API tutorials
- 40+video courses
- 35+interactive quizzes
- 70+coding exercises
- 5guided learning paths
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.
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
Become a Python Web Developer
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.
-
2
FastAPI: Python API Development With Light Speed
Build REST APIs with Pydantic models, serve web pages with Jinja2 templates, and finish with a complete URL shortener project.
-
2
Django for Web Development
Go from project setup to REST APIs, covering models and migrations, the admin, user management, and advanced patterns.
-
2
Flask by Example
Build Flask apps from your first project to deployment, with Jinja templates, databases, REST APIs, and JavaScript front ends.
-
Python Web Scraping
Work with the web from the other side: send HTTP requests, parse pages with Beautiful Soup and Scrapy, and automate browsers with Selenium.
New to Python itself? Start with Python Basics first.
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.
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 →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.
Meet Mentor AI →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?
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.
Learn the tools web teams actually use
From the major frameworks to the libraries you’ll reach for in every project.
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.
See all web development content →- 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
Do I need to know Python before I start?
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.
Should I learn Django, Flask, or FastAPI?
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.
Do I need to know JavaScript?
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.
Do I need to set up a server to practice?
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.
What’s included in a membership?
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.