-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
37 lines (25 loc) · 809 Bytes
/
config.py
File metadata and controls
37 lines (25 loc) · 809 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
import os
# Adapted from Miguel Grinberg: Flask Web Development, Second Edition (O'Reilly).
class Config:
DEBUG = False
TESTING = False
JWT_SECRET_KEY = os.environ['JWT_SECRET_KEY']
LOG_FILE_PATH = os.environ['LOG_FILE_PATH']
SENTRY_DSN = os.getenv('SENTRY_DSN')
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = os.environ['DEV_DATABASE_URI']
class TestingConfig(Config):
TESTING = True
SQLALCHEMY_DATABASE_URI = os.environ['TEST_DATABASE_URI']
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URI']
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}