Python Backend, APIs & Databases
Build production-ready Python backends from scratch: 15 hands-on lessons across 6 modules covering REST & JSON APIs, httpx clients, SQLite & transactions, FastAPI & Pydantic, password hashing & token auth, pytest TestClient, Docker/migrations, and a full REST API capstone.
Course Syllabus
1. HTTP, REST APIs & External Services
0/2 done- 6 min
1. HTTP, RESTful API Design & JSON Payloads
Learn how modern Python backends communicate over HTTP: resource-oriented REST URLs, HTTP methods, idempotency, status codes, headers, and clean JSON contracts.
- 5 min
2. Calling External APIs Safely: httpx, Timeouts, Retries & Pagination
Consume third-party REST APIs reliably in Python using httpx, mandatory timeouts, bearer headers, exponential backoff retries, and paginated loops.
2. Python + SQL Databases
0/3 done- 6 min
3. Connecting Python to SQL with sqlite3 (No SQL Injection)
Query relational databases directly from Python using the built-in sqlite3 module, Row dictionary-like access, and parameterized ? placeholders that prevent SQL injection.
- 5 min
4. Transactions, Repository Pattern & Intro to SQLAlchemy
Protect multi-step database writes with atomic transactions, organize SQL queries cleanly with the Repository pattern, and see how ORMs like SQLAlchemy 2.0 map classes to tables.
- 4 min
5. Practice Lab 1: Build a Safe SQLite Enrollment Repository
Combine Module 2 skills in a live in-memory SQLite lab: write parameterized inserts, foreign-key lookups, atomic enrollment counts, and automated assert checks.
3. Building Web APIs with FastAPI & Pydantic
0/3 done- 5 min
6. FastAPI Essentials: Routes, Path/Query Parameters & OpenAPI Docs
Build fast, self-documenting Python web APIs with FastAPI: understand ASGI and uvicorn, route decorators, path vs query parameters, and automatic /docs Swagger UI.
- 5 min
7. Request & Response Validation with Pydantic BaseModel
Validate incoming JSON payloads, enforce field constraints with Field(), write custom validators, and separate input vs public output schemas using Pydantic v2.
- 4 min
8. Full CRUD Endpoints, HTTPException & Dependency Injection
Connect FastAPI routes cleanly to SQLite repositories using Depends(), raise explicit 404/409 responses with HTTPException, and implement complete POST/GET/PATCH/DELETE CRUD.
4. Authentication, Security & Configuration
0/3 done- 5 min
9. Configuration, .env Secrets, CORS & API Security Basics
Keep API keys and database URLs out of Git using .env and pydantic-settings, configure CORS safely for frontends, and apply essential backend security practices.
- 5 min
10. Password Hashing & Bearer Token / JWT Authentication
Store user passwords safely with salted key stretching (pbkdf2_hmac / bcrypt), prevent timing attacks with hmac.compare_digest, and issue signed stateless Bearer tokens.
- 4 min
11. Practice Lab 2: Request Auth Guard & Token Validation
Put Modules 3 and 4 into practice: implement Bearer header extraction, signed token verification with expiration checks, and role-based 401/403 authorization guards.
5. Testing, Background Jobs & Deployment
0/3 done- 4 min
12. Testing APIs with pytest, TestClient & Isolated Databases
Test FastAPI endpoints automatically without launching a server: use TestClient, override Depends(get_db) with isolated per-test SQLite fixtures, and verify status codes and JSON.
- 5 min
13. Async Endpoints, Background Tasks & Caching Patterns
Avoid freezing your FastAPI event loop: know when to write async def vs def routes, offload slow emails/reports with BackgroundTasks, and speed up hot reads with caching.
- 5 min
14. Database Migrations (Alembic), Dockerfiles & Deploying Python APIs
Ship Python backends reliably: evolve database schemas safely with Alembic migrations, containerize with a lean Dockerfile, add /health checks, and run multiple Uvicorn workers.
Earn Your Python Backend, APIs & Databases Certificate
Take the final assessment once you finish the lessons. Score 70% or higher to unlock a printable completion certificate.
Quick Reference
Python Backend, FastAPI & SQLite Cheat Sheet
Quick reference for Python backend development: REST status codes, httpx timeouts/retries, parameterized sqlite3 + transactions, FastAPI routes, Pydantic v2 schemas, Depends(), auth hashing/JWT, TestClient overrides, and Docker.
What Next?
Explore Career Learning Roadmaps
See how this course connects with Python, SQL, Git, and Web Development paths.