import os # Flask app configuration class Config: SECRET_KEY = os.environ.get('SECRET_KEY', 'dev-secret-key') DEBUG = False TESTING = False class DevelopmentConfig(Config): DEBUG = True class TestingConfig(Config): TESTING = True class ProductionConfig(Config): DEBUG = False # Configuration dictionary config = { 'development': DevelopmentConfig, 'testing': TestingConfig, 'production': ProductionConfig, 'default': DevelopmentConfig } # Get configuration by name def get_config(config_name): return config.get(config_name, config['default'])