Edocti
Advanced Technical Training for the Software Engineer of Tomorrow
Edocti Training

Flask & SQLAlchemy — Micro Training (4h)

Intermediate
4 h
4.7 (503 reviews)
Flask & SQLAlchemy — Micro Training (4h)

Flask & SQLAlchemy essentials: build a small web app with persistent storage in just 4 hours.

Hands-on practice creating routes, templates and ORM models.

Understand how Flask integrates with SQLAlchemy for queries and transactions.

Gain practical experience through labs coding each step of the app.

How this helps: quickly bootstrap prototypes or add persistence to Python projects.

Who it’s for: designed for individuals with Python basics entering web development.

Includes optional pointers to scaling patterns and advanced ORM features.

Curriculum

Part 1 — Project setup & architecture
  • App factory pattern, Blueprints and configuration (dev/test/prod)
  • Database URL, engine, Session; using Flask‑SQLAlchemy vs. plain SQLAlchemy
  • Request lifecycle and session‑per‑request pattern; teardown and error handlers
  • Alembic init and first migration; seeding data
Part 2 — Modeling & querying with SQLAlchemy ORM
  • Models, columns and constraints; timestamps and UUIDs
  • One‑to‑many / many‑to‑many relationships; backrefs, cascades
  • Query patterns: filtering, joins, selectinload vs joinedload; pagination
  • Validation at the boundary (Marshmallow or Pydantic)
Part 3 — REST endpoints & transactions
  • Create/read/update/delete endpoints; idempotency and upserts (brief)
  • Transactions and isolation basics; commit/rollback; 404/409/422 responses
  • Error handling and problem+json; mapping DB exceptions to HTTP
  • Auth placeholder: JWT skeleton (optional)
Part 4 — Tests, performance & deployment tips
  • pytest fixtures; temporary DB (SQLite) vs. Postgres in Docker
  • Factory‑driven app tests; transactional tests and rollbacks
  • Avoid N+1; indexes and EXPLAIN (intro); connection pool sizing basics
  • Packaging and running with Gunicorn; `.env` and 12‑factor notes

Optional modules

Optional — Docker Compose quickstart
  • Compose file with Postgres and the app; runtime env vars
  • Healthchecks, migrations on startup, and seed data

Course Day Structure

  • Part 1: 09:00–10:00
  • Break: 10:00–10:10
  • Part 2: 10:10–11:10
  • Break: 11:10–11:20
  • Part 3: 11:20–12:20
  • Break: 12:20–12:30
  • Part 4: 12:30–13:30