0PricingLogin
Flask Academy · Lesson

Config Classes per Environment

Define Dev, Test, and Prod settings.

One App, Many Worlds

Your app runs in different environments: your laptop, a test runner, and a live server. Each one needs its own settings.

What a Config Class Is

A config class is just a Python class whose attributes become Flask settings. Group related options together and read them in once.

class Config:
    DEBUG = False
    TESTING = False

All lessons in this course

  1. Config Classes per Environment
  2. Load Secrets from Environment Variables
  3. Use dotenv in Development
  4. Toggle Debug and Feature Flags
← Back to Flask Academy