Before you code: complete setup and practice loop
- Install Python 3.12+ and VS Code, then open a new folder named
api-camp-practice. - In the VS Code terminal create and activate a virtual environment, then run
python -m pip install requests pytest playwright pytest-playwright fastapi httpx sqlalchemy. - Run
python -m playwright install chromium, createmain.py, and copy the starter code from the editor. - Read the lesson's Why this matters and Build it step by step, then replace every
TODOandpass. - Use Run Code for a quick structure check and Check Solution for every requirement. Then run the lesson's real terminal command locally.
Quick shortcut
Create and activate venv
-
Create the virtual environment
python -m venv venv -
Activate it for your terminal
Windows (Command Prompt)
venv\Scripts\activateWindows (PowerShell)venv\Scripts\Activate.ps1macOS/Linux (Bash/Zsh)source venv/bin/activate
Important: this page checks code structure safely; it cannot execute Python or contact an API. The “Run it for real” section in every lesson gives you the exact local command.
Ready. Run your code to inspect it, then check it against the challenge tests.