-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
51 lines (35 loc) · 868 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
42
43
44
45
46
47
48
49
50
51
# config.py
import os
class Config:
"""
Common configurations
"""
SECRET_KEY = os.environ.get('SECRET_KEY', 'some value')
SQLALCHEMY_DATABASE_URI = os.environ.get(
'DATABASE_URL', 'postgresql://db_user:password@localhost/weconnect_db')
TESTING = False
DEBUG = False
CSRF_ENABLED = True # protect against CSRF attacks
SQLALCHEMY_TRACK_MODIFICATIONS = False
class DevelopmentConfig(Config):
"""
Development configurations
"""
DEBUG = True
SQLALCHEMY_ECHO = True
class ProductionConfig(Config):
"""
Production configurations
"""
DEBUG = False
TESTING = False
class TestingConfig(Config):
"""
Testing configurations
"""
TESTING = True
app_config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'testing': TestingConfig
}