-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
43 lines (36 loc) · 1.05 KB
/
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
# config.py
import os
# Enable Flask's debugging features. Should be False in production
class Config(object):
"""
Common configurations
"""
# Put any configurations here that are common across all environments
DEBUG = False
CSRF_ENABLED = True
SECRET = os.getenv('SECRET')
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL')
class DevelopmentConfig(Config):
"""
Development configurations
"""
DEBUG = True
TESTING = True
# SQLALCHEMY_DATABASE_URI = 'postgresql://%(user)s:\
# %(pw)s@%(host)s:%(port)s/%(db)s' % POSTGRES
class TestingConfig(Config):
"""Configurations for Testing, with a separate test database."""
TESTING = True
# SQLALCHEMY_DATABASE_URI = 'postgresql://test:admin@localhost/test_db'
SQLALCHEMY_DATABASE_URI = os.getenv('TEST_DATABASE_URL')
DEBUG = True
class ProductionConfig(Config):
"""
Production configurations
"""
DEBUG = False
app_config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig
}