-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
41 lines (28 loc) · 859 Bytes
/
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
import os
class Config:
DEBUG = False
CSRF_ENABLED = True
SECRET = os.getenv('SECRET')
POSTGREST_DATABASE_URI = os.getenv('DATABASE_URL')
DB_NAME = os.getenv('DB_NAME')
JWT_SECRET_KEY = os.getenv('JWT_SECRET_KEY')
TEST_DB = os.environ.get('TEST_DB')
class DevelopmentConfig(Config):
DEBUG = True
class TestingConfig(Config):
DEBUG = True
TESTING = True
# POSTGREST_DATABASE_URI = os.environ.get('TEST_DB')
class StagingConfig(Config):
DEBUG = True
class ProductionConfig(Config):
DEBUG = False
TESTING = True
app_config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'staging': StagingConfig,
'production': ProductionConfig
}
AppConfig = TestingConfig if os.getenv('APP_SETTINGS') == 'testing' else app_config.get(
os.getenv('FLASK_ENV'), 'development')