-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
48 lines (34 loc) · 1.13 KB
/
config.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import os
basedir = os.path.abspath(os.path.dirname(__file__))
POSTGRES_PASSWORD = os.getenv("POSTGRES_PASSWORD")
class Config:
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = "your-secret-key-here"
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_DATABASE_URI = "postgresql://testinguser:password@localhost/dbname"
class ProductionConfig(Config):
DEBUG = False
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
class StagingConfig(Config):
DEVELOPMENT = True
DEBUG = True
SQLALCHEMY_DATABASE_URI = "postgresql://user:password@localhost/dbname"
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
SQLALCHEMY_DATABASE_URI = "postgresql://user:password@localhost/dbname"
class TestingConfig(Config):
TESTING = True
SQLALCHEMY_DATABASE_URI = (
f"postgresql://testinguser:{POSTGRES_PASSWORD}@localhost:5432/testingdemo"
)
config = {
"development": DevelopmentConfig,
"testing": TestingConfig,
# Add more configurations as needed
"default": Config,
"production": ProductionConfig,
"staging": StagingConfig,
}