-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
29 lines (24 loc) · 785 Bytes
/
config.py
File metadata and controls
29 lines (24 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# config.py
"""
Configuration classes for the Flask application. Each class configures the application
for a different environment.
"""
import os
class Config:
"""
Base configuration with settings applicable to all environments.
"""
SECRET_KEY = os.getenv('SECRET_KEY', 'default_secret_key')
DEBUG = False
TESTING = False
ENV = 'production' # Default to production
class ProductionConfig(Config):
DATABASE_URI = os.getenv('PRODUCTION_DATABASE_URI', 'product_db')
class DevelopmentConfig(Config):
DEBUG = True
ENV = 'development'
DATABASE_URI = os.getenv('DEVELOPMENT_DATABASE_URI', 'development_db')
class TestingConfig(Config):
TESTING = True
ENV = 'testing'
DATABASE_URI = os.getenv('TESTING_DATABASE_URI', 'testing_db')