-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
40 lines (25 loc) · 845 Bytes
/
config.py
File metadata and controls
40 lines (25 loc) · 845 Bytes
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
import os ,configparser
conf=configparser.ConfigParser()
conf.read("config.ini")
class Config:
SECRET_KEY=conf.get('global','SECRET_KEY')
FLASKY_ADMIN=conf.get('admin','FLASKY_ADMIN')
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG=True
SQLALCHEMY_DATABASE_URI=conf.get('database','DEV_DATABASE_URL')
HEAD_PORTRAIT=conf.get('img','DEV_HEAD_PORTRAIT')
class TestingConfig(Config):
Testing=True
SQLALCHEMY_DATABASE_URI = conf.get('database', 'TEST_DATABASE_URL')
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = conf.get('database', 'DATABASE_URL')
HEAD_PORTRAIT = conf.get('img', 'HEAD_PORTRAIT')
config={
'development':DevelopmentConfig,
'testing':TestingConfig,
'production':ProductionConfig,
'default':DevelopmentConfig
}