-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
50 lines (36 loc) · 1.15 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
49
50
# config.py
"""Define configuration for different development stages."""
import os
class Config(object):
"""Parent configuration class."""
DEBUG = False
JWT_SECRET_KEY = os.getenv('SECRET_KEY')
JWT_BLACKLIST_ENABLED = True
JWT_BLACKLIST_TOKEN_CHECKS = ['access', 'refresh']
SWAGGER = {'title': 'WeConnect v2.0', 'uiversion': 2}
class DevelopmentConfig(Config):
"""Configuration for Development."""
DEBUG = True
CSRF_ENABLED = True
SQLALCHEMY_ECHO = True
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL_DEV')
class TestingConfig(Config):
"""Configuration for testing stage."""
DEBUG = True
TESTING = True
SQLALCHEMY_DATABASE_URI = \
"postgresql://test_user:default@localhost/test_db"
class StagingConfig(Config):
"""Configurations for Staging."""
DEBUG = True
class ProductionConfig(Config):
"""Configuration for production stage."""
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL')
app_config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'staging': StagingConfig,
'production': ProductionConfig
}