-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
41 lines (30 loc) · 1002 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
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = 'this-really-needs-to-be-changed'
SQLALCHEMY_DATABASE_URI = os.environ["DBHOST"]
class ProductionConfig(Config):
DEBUG = False
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://{dbuser}:{dbpass}@{dbhost}/{dbname}'.format(
dbuser=os.environ['DBUSER'],
dbpass=os.environ['DBPASS'],
dbhost=os.environ['DBHOST'],
dbname=os.environ['DBNAME']
)
class StagingConfig(Config):
DEVELOPMENT = True
DEBUG = True
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://{dbuser}:{dbpass}@{dbhost}/{dbname}'.format(
dbuser=os.environ['DBUSER'],
dbpass=os.environ['DBPASS'],
dbhost=os.environ['DBHOST'],
dbname=os.environ['DBNAME']
)
class TestingConfig(Config):
TESTING = True