-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
37 lines (28 loc) · 947 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
import os
import ConfigParser
DIRNAME = os.path.abspath(os.path.dirname(__file__))
config = ConfigParser.ConfigParser()
config.read(os.path.join(DIRNAME, 'etd.ini'))
# default config
class BaseConfig(object):
DEBUG = False
SECRET_KEY = "asd252rg242tqwf5y6h4wefefa"
# dev
class DevelopmentConfig(BaseConfig):
DEBUG = True
SQLALCHEMY_DATABASE_URI = "%s://%s:%s@%s/earntheday" % (
config.get('development', 'db_engine'),
config.get('development', 'db_username'),
config.get('development', 'db_password'),
config.get('development', 'db_host')
)
# prod
class ProductionConfig(BaseConfig):
DEBUG = False
SQLALCHEMY_DATABASE_URI = "%s://%s:%s@%s/earntheday" % (
config.get('production', 'db_engine'),
config.get('production', 'db_username'),
config.get('production', 'db_password'),
config.get('production', 'db_host')
)
settings = DevelopmentConfig