-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
29 lines (21 loc) · 882 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
from os import environ
class Config:
BASE_URL = environ.get('BASE_URL', 'http://127.0.0.1:5000/')
STRIPE_PUBLISHABLE_KEY=environ.get("STRIPE_PUBLISHABLE_KEY")
STRIPE_SECRET_KEY=environ.get("STRIPE_SECRET_KEY")
STRIPE_ENDPOINT_SECRET=environ.get("STRIPE_ENDPOINT_SECRET")
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG=True
SQLALCHEMY_DATABASE_URI = f"postgresql://{environ.get('POSTGRES_USER')}:{environ.get('POSTGRES_PASSWORD')}@db/{environ.get('POSTGRES_DEV_DB')}"
class TestingConfig(Config):
DEBUG = True
TESTING = True
SQLALCHEMY_DATABASE_URI = f"postgresql://{environ.get('POSTGRES_USER')}:{environ.get('POSTGRES_PASSWORD')}@db/{environ.get('POSTGRES_TEST_DB')}"
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'default': DevelopmentConfig
}