# Settings Checked at Startup

An API reads every setting it needs from environment variables, or from a .env file on your own computer, through one pydantic-settings BaseSettings class that gives each setting a type and a default, so a missing or mistyped setting stops the app as it starts, with a message naming every problem, instead of crashing a later request.

![Cheat sheet: Settings Checked at Startup](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/472e3536b6e44f86946f901580aad449.webp)

- Category: FastAPI
- Level: Journeyman
- Tags: env-file, Environment Variable (python), Fail Fast, fastapi, rest-api, Settings with pydantic-settings
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/fastapi-pro-settings-cheat-sheet
