Skip to main content
FastAPI Docs

Search documentation

Type to search this documentation.

On this pageOverview

Environment Variables

An environment variable (also known as an env var) is a value that lives outside of your Python code, in the operating system, and can be read by your application and other programs.

FastAPI applications commonly use environment variables for configuration such as database URLs, email credentials, and secret keys.

You will learn how to use them for application configuration in Settings and Environment Variables.

Read the Environment Variables guide for a detailed, cross-platform explanation, including how to create and read environment variables and how the PATH environment variable works.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu