Skip to content

Run locally

Install Git and Python 3.12, then clone main:

git clone https://github.com/jeffrey-groneberg/the-mai-workshop.git
cd the-mai-workshop

Install

macOS / Linux

python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt

Windows PowerShell

py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txt

On Windows, use .\.venv\Scripts\python.exe wherever a lesson says python.

Configure

Copy .env.example to a root .env. Fill in APIM_BASE_URL with the Shared gateway origin, without an API path, and APIM_API_KEY with your participant key; Get your gateway values shows where to find both. Existing environment variables override .env.

Start

Run these in separate terminals. On macOS/Linux, activate the environment in each terminal first.

python -m flask --app starter/app.py run --reload --host 127.0.0.1 --port 5050
python -m flask --app solution/app.py run --reload --host 127.0.0.1 --port 5051

Open your app and the solution. Follow lesson 00 using these local commands.

With --reload, saving a Python or HTML file refreshes Flask on its own; reload the browser afterwards. Restart Flask yourself after changing .env.

Preview the guide

Optional; otherwise read the published workshop.

python -m pip install -r requirements-docs.txt
zensical serve --dev-addr 127.0.0.1:8000

On Windows, use .\.venv\Scripts\zensical.exe for the second command.