Flask
Build web apps and APIs with a small, honest framework. Real Flask runs right here. 16 modules of 10 minutes each, with questions that check your answers in the browser.
Foundations
- 1. What a web framework does; request/responseFreeUnderstand what really happens when a browser loads a page, the parts of an HTTP request and response, and which jobs a framework like Flask takes off your hands.
- 2. Your first Flask app and routesFreeCreate a Flask app, connect URLs to Python functions with @app.route, and send requests to it.
- 3. Dynamic routes and URL parametersFreeCapture parts of the URL as function arguments, convert them to the right type, return 404 for unknown items, and build URLs with url_for.
- 4. HTTP methods: GET and POSTFreeHandle reading and sending data on the same URL, read posted form data, follow the Post/Redirect/Get pattern, and return the right status codes.
Intermediate
- 5. Templates with Jinja2FreeMove HTML out of Python into templates, fill them with data, loop and branch inside them, share a base layout, and let auto-escaping keep you safe.
- 6. Serving static filesFreeServe CSS, images, JavaScript and downloadable files from the static folder, link them with url_for, and send files generated on the fly.
- 7. Handling form data and query stringsFreeRead search filters from the query string and submitted forms from the body, convert and validate them, and redisplay a form with errors.
- 8. Returning JSON and building a simple APIFreeBuild a small REST API that lists, reads, creates, updates and deletes resources with JSON, consistent URLs and correct status codes.
Advanced
- 9. Blueprints and app structureProSplit a growing Flask app into blueprints, each with its own routes and URL prefix, and register them on one app.
- 10. Working with a database (SQLAlchemy intro)ProStore data in a real database with Flask-SQLAlchemy models, query and change it from routes, and keep it safe with sessions and commits.
- 11. Error handling and status codesProChoose the right status code for every outcome, register error handlers for friendly pages and JSON, raise your own HTTP errors, and log unexpected failures.
- 12. Sessions and cookiesProRemember things about a visitor between requests with cookies and Flask's signed session, build a shopping cart, and keep it secure.
Expert
- 13. Application factory pattern and configProCreate the app inside a function, load configuration per environment from classes and environment variables, and make apps easy to test.
- 14. Authentication basicsProStore passwords safely with hashing, log users in and out with the session, protect routes with a login_required decorator, and check permissions.
- 15. Testing a Flask appProTest routes with the test client and pytest fixtures, use a fresh app and database per test, cover errors and permissions, and test logic without HTTP.
- 16. Clean project structure for a real appProPut everything together, factory, blueprints, services, models, config, tests, into a layout that stays understandable as the app grows.
Track project
- Flask Project: Toko Kita's shop backendProThree graded tasks that build the back end of a real shop. An orders API that validates everything and keeps stock right, a product search endpoint with filters and sorting, and a shop page rendered from a shared layout.
Pro modules unlock with one payment of Rp 149.000, yours to keep.