-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
60 lines (52 loc) · 1.39 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
51
52
53
54
55
56
57
58
59
60
'''
GLOBAL SETTINGS:
'''
from secret import *
basedir = os.path.abspath(os.path.dirname(__file__))
class BaseConfig(object):
DEBUG = False
TESTING = False
SECRET_KEY = APP_SECRET_KEY
ROOT_PATH = os.path.abspath(os.path.dirname(__file__))
UPLOAD_IMG_FOLDER = os.path.abspath(os.path.join(os.getcwd(), 'app', 'static', 'uploads'))
ALLOWED_IMG_EXTENSIONS = ['png', 'jpg', 'jpeg']
'''
EXTENSIONS = [
'ext.db',
'ext.assets',
'ext.login_manager',
'ext.gravatar',
'ext.toolbar',
]
'''
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(BaseConfig):
DEBUG = True
DEBUG_TB_PROFILER_ENABLED = True
DEBUG_TB_INTERCEPT_REDIRECTS = False
# WTF_CSRF_ENABLED = False
'''
DATABASE CONNECTION
'''
SQLALCHEMY_DATABASE_URI = SQLALCHEMY_DATABASE
class TestingConfig(BaseConfig):
TESTING = True
WTF_CSRF_ENABLED = False
'''
DATABASE CONNECTION
'''
SQLALCHEMY_DATABASE_URI = SQLALCHEMY_DATABASE
class ProductionConfig(BaseConfig):
WTF_CSRF_ENABLED = True
'''
DATABASE CONNECTION
'''
SQLALCHEMY_DATABASE_URI = SQLALCHEMY_DATABASE
config = {
'development': DevelopmentConfig,
'test': TestingConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}