Your browser doesn't support speech here. You can still read everything, or try Chrome, Edge or Safari.
Course 9 of 10 · Intermediate
Flask & Deployment
Put your models online. How the web works, Flask apps, templates and forms, databases, REST APIs, serving an ML model, testing, Docker and deploying to the cloud with monitoring.
How this course works
Welcome
- Level: Intermediate. You need: Python and SQL. Machine Learning for the model-serving topics.
- Before you start: Python and SQL. For the model-serving topics, finish the core of Machine Learning.
- Flask runs a web server, so its code runs on your own computer: each example shows the commands.
- Pick a topic from the sidebar; they go in order. Press ▶ Play this topic to hear a lesson read aloud, or 🔊 Explain on one section.
- Topics climb from Beginner to Intermediate · Maths, Advanced and Code; use the Show chips to hide levels you don't need. Most have a Watch it animation, Try it demos and runnable code examples, and every topic ends with a quiz: answer it to mark the topic done ✓.
- Stuck? Press 💬 Ask the AI tutor: a small free AI model that runs on your own device and answers from the course.
- Progress is saved in this browser and shared across all the courses on this site.
Learning path: 🐍 Python → 🗄️ SQL & Databases → ∑ Maths for AI → 📈 Machine Learning → 🧠 Deep Learning → 👁️ Computer Vision → 💬 Natural Language Processing → ✨ Generative AI & LLM Apps → 🚀 Flask & Deployment → 🔬 Becoming an AI Researcher
Web apps with Flask
1. Flask Course: Start Here: How the Web WorksWhat happens when you open a web page: clients and servers, URLs, HTTP requests and responses, methods and status codes, HTML, CSS and JavaScript, and where Flask fits among Python web frameworks.2. Your First Flask AppSet up a project with a virtual environment, write routes that return text, HTML and JSON, read URL variables, query strings and request data, run the development server, and understand what debug mode does.3. Templates, Forms & Static FilesBuild HTML pages with Jinja templates (variables, loops, conditions, inheritance), link pages with url_for, serve CSS and images, handle forms with GET and POST, validate input, show flash messages, and protect forms against XSS and CSRF attacks.4. Databases, Users & Structuring an AppStore data with Flask-SQLAlchemy models, create, read, update and delete records safely, change the schema with migrations, add logins with hashed passwords, and organise a growing app with an app factory and blueprints.
APIs and models
5. Building REST APIsDesign a JSON API: resources and URLs, methods and status codes, validating request bodies, consistent error responses, pagination, authentication with tokens, CORS, versioning and documentation, and when to choose FastAPI.6. Serving a Machine-Learning ModelSave a trained scikit-learn pipeline, load it once when the app starts, build a /predict endpoint with input validation and a model version in every response, handle batches, measure latency, and serve LLM features safely.7. Testing, Configuration & LoggingTest Flask apps with pytest and the test client, keep secrets and settings in environment variables, write useful logs, and run your tests automatically on every push with GitHub Actions.
Shipping to production
8. Docker: Package Your AppWhy containers solve "it works on my machine", images and containers, a production Dockerfile for Flask with gunicorn, layer caching, .dockerignore, small and secure images, and running an app with its database using Docker Compose.9. Deploying to the CloudThe kinds of hosting (platforms, serverless containers, ML-demo hosts, virtual machines), deploying a container step by step, environment variables and managed databases, HTTPS and custom domains, scaling, cost control, and continuous deployment.10. Monitoring, MLOps & Security in ProductionKeep an app healthy after launch: health checks, logs, metrics and alerts; what is special about ML in production (data drift, delayed labels, model registries, safe rollouts and retraining); and a security checklist.11. Project: Put Your Model OnlineShip a complete, portfolio-ready app: a Flask web page and JSON API around a trained model, with validation, tests, CI, Docker, a cloud deployment, monitoring and a clear README.12. ✅ Checkpoint: Flask & DeploymentA mixed quiz on the whole Flask & Deployment course. Pass mark: 7 of 10 on the first try.
When you finish