-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
49 lines (34 loc) · 1002 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
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
# security
WTF_CSRF_ENABLED = True
SECRET_KEY = 'waddehaddedudenda'
# database
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
SQLALCHEMY_TRACK_MODIFICATIONS = True
# properties
FLASKY_POSTS_PER_PAGE = 10
@staticmethod
def init_app(app):
pass
class DevConfig(Config):
# database
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite')
# properties
DEBUG = True
class TestConfig(Config):
# database
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data-test.sqlite')
# properties
TESTING = True
class WorkingConfig(Config):
# database
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data.sqlite')
config = {
'dev': DevConfig,
'test': TestConfig,
'work': WorkingConfig,
'default': DevConfig
}