-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
43 lines (31 loc) · 850 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
import os
class Config(object):
"""
Common configurations
"""
DEBUG = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = os.environ.get('SECRET_KEY')
FLASKY_POSTS_PER_PAGE = 4
class DevelopmentConfig(Config):
"""
Development configurations
"""
SQLALCHEMY_DATABASE_URI = os.environ.get('DB_URL')
DEBUG = True
SQLALCHEMY_ECHO = True
class TestingConfig(Config):
"""Configurations for Testing, with a separate test database."""
TESTING = True
SQLALCHEMY_DATABASE_URI = os.environ.get('TESTDB')
class ProductionConfig(Config):
"""
Production configurations
"""
DEBUG = False
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
app_config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig
}