Raahaao Code: Flask
Build real Python websites and APIs with Flask.
9+ hours of lessons · 2 projects · €35
Helps you prepare for: PCAP – Certified Associate Python Programmer (Python Institute)
Or get it in a monthly plan from €3.46 a week (billed €15 monthly) →
You need an account to open any lessons. Without one you can browse the towers and prices.
What you'll learn, floor by floor
- 1
First app (Beginner)
- How a web framework works
- Routes and views
- Templates with Jinja
- 2
Forms & data (Beginner)
- Request data
- Validation and flash messages
- Static files and layout
- 3
Storage (Intermediate)
- SQLite from Flask
- CRUD pages
- Blueprints and app factories
- 4
Users (Intermediate)
- Sessions and cookies
- Logins with hashed passwords
- Authorisation: roles and ownership
- 5
Pro (Job-ready)
- JSON APIs
- Security essentials
- Testing a Flask app
- Deploying Flask
The two rooftop projects
Link-in-bio builder
Build a small Flask service where people can register, sign in, and maintain a public profile with useful links. The app uses SQLite for accounts and profile data, a signed session to remember the current user, and password hashes instead of readable passwords.
- create_app(test_config=None) returns a configured Flask application and accepts per-app configuration, including DATABASE and SECRET_KEY
- POST /register accepts JSON username and password, creates a user and empty profile, returns {"username": username} with 201, returns 400 for invalid input, and 409 for a duplicate username
- POST /login verifies a username and password, returns {"username": username} with 200 and stores the user id in the session; invalid credentials return {"error": "Invalid username or password"} with 401; POST /logout clears the session and returns {"message": "Logged out"} with 200; passwords are stored as Werkzeug hashes
- PUT /api/me requires login and accepts JSON display_name, bio, and links; display_name must be 1–80 characters, bio at most 160 characters, and links a list of at most 5 absolute http or https URLs; valid data is saved and returned with 200, invalid data returns a JSON error with 400, and anonymous requests return 401
- GET /u/<username> returns an HTML public profile page with display name, bio, and links; user-provided text is HTML-escaped and an unknown username returns {"error": "Profile not found"} with 404
- Profile edits are limited to the authenticated owner; unauthenticated edit requests return {"error": "Login required"} with 401
- GET /api/u/<username> returns {"username": username, "display_name": display_name, "bio": bio, "links": links} with 200, or {"error": "Profile not found"} with 404
Class booking system
Build a Flask app for a small class studio, where customers can book a place and cancel their own booking. An admin can create classes with a time and capacity, and clients can inspect the schedule through a JSON API.
- create_app(config=None) returns a fresh Flask application and applies configuration overrides.
- The app stores classes and bookings in SQLite, using parameterized SQL and the configured DATABASE path.
- Only a session with role "admin" can create a class.
- GET /api/classes returns 200 JSON with the shape {"classes": [...]} and each class has id, name, starts_at, capacity, and booked.
- A customer can book an available class with POST /api/classes/<int:class_id>/book, receiving 201 JSON {"booking_id": id, "class_id": class_id}.
- A customer cannot book the same class twice; the repeated request returns 409 JSON {"error": "already booked"}.
- A class cannot be overbooked; a booking when it is full returns 409 JSON {"error": "class is full"}.
- A customer can cancel their own booking with DELETE /api/bookings/<int:booking_id>, receiving 200 JSON {"cancelled": true}.
- A customer cannot cancel another customer’s booking; the response is 404 JSON {"error": "booking not found"}.
- Booking a class that does not exist returns 404 JSON {"error": "class not found"}.
- Invalid class input returns 400 JSON {"error": "name and starts_at are required; capacity must be a positive integer"}.
- Unauthenticated booking requests return 401 JSON {"error": "login required"}; non-admin class creation returns 403 JSON {"error": "admin required"}.
- The learner writes at least five test_ functions in app.py and runs each one with Flask’s test client.
Questions
Do I need to install anything?
No. Everything runs in your browser. For the projects you can also work on your own computer and upload your files.
Can I skip what I already know?
Yes. Once you own a tower, each floor has a skip test: score 8 out of 10 and that floor opens.
What is the refund policy?
Refunds within 5 days of purchase. After 5 days, no refunds or returns.
Do I keep access?
Yes. A tower you buy is yours, with no subscription.
The towers
HTML & CSS · JavaScript · Python · SQL · C++ · Node.js · Python for Data · Logic & Problem Solving · Algorithms & Data Structures · Java · Machine Learning · Building with AI