· 8 years ago · Jan 04, 2018, 08:52 PM
1import os
2basedir = os.path.abspath(os.path.dirname(__file__))
3
4class Config(object):
5 DEBUG = False
6 TESTING = False
7 CSRF_ENABLED = True
8 DB_NAME = 'idea360'
9 SECRET_KEY = os.environ.get('JWT_SECRET')
10 SQLALCHEMY_ACCESS = 'postgresql://postgres:{}@postgres'.format(
11 os.environ.get('POSTGRES_PASSWORD')
12 )
13 SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:{}@postgres/{}'.format(
14 os.environ.get('POSTGRES_PASSWORD'), DB_NAME
15 )
16
17
18class ProductionConfig(Config):
19 DEBUG = False
20
21
22class StagingConfig(Config):
23 DEVELOPMENT = True
24 DEBUG = True
25
26
27class DevelopmentConfig(Config):
28 DEVELOPMENT = True
29 DEBUG = True
30
31
32class TestingConfig(Config):
33 TESTING = True
34 DEBUG = False
35 DB_NAME = 'idea360_test'
36 PRESERVE_CONTEXT_ON_EXCEPTION = False
37 SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:{}@postgres/{}'.format(
38 os.environ.get('POSTGRES_PASSWORD'), DB_NAME
39 )
40
41app_config = {
42 'development': DevelopmentConfig,
43 'test': TestingConfig
44}