-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
40 lines (30 loc) · 953 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
import os
from datetime import timedelta
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = os.environ['SECRET_KEY']
JWT_SECRET_KEY = os.environ['JWT_KEY']
JWT_EXPIRES = timedelta(days=7)
SQLALCHEMY_DATABASE_URI = os.environ['SQLALCHEMY_DATABASE_URI']
SQLALCHEMY_ENGINE_OPTIONS = {
"pool_pre_ping": True
}
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
# SQLALCHEMY_ECHO = True
class TestingConfig(Config):
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://localhost/shelter_caller_test'
TESTING = True
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = os.environ['SQLALCHEMY_DATABASE_URI']
DEBUG = False
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}