-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
31 lines (22 loc) · 987 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
import os
from datetime import timedelta
app_dir = os.path.abspath(os.path.dirname(__file__))
class BaseConfig:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'SECRET_KEY'
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_KEY') or 'JWT_SECRET_KEY'
JWT_ACCESS_TOKEN_EXPIRES = timedelta(weeks=1)
SQLALCHEMY_TRACK_MODIFICATIONS = False
CSRF_ENABLED = True
class DevelopmentConfig(BaseConfig):
DEBUG = True
SQLALCHEMY_DATABASE_URI = os.environ.get(
'DEVELOPMENT_DATABASE_URI') or 'postgresql://postgres:inn_time_db_password@db:5432/inn_time'
class TestingConfig(BaseConfig):
DEBUG = True
TESTING = True
SQLALCHEMY_DATABASE_URI = os.environ.get(
'TESTING_DATABASE_URI') or 'postgresql://postgres:inn_time_db_password@db:5432/inn_time'
class ProductionConfig(BaseConfig):
DEBUG = False
SQLALCHEMY_DATABASE_URI = os.environ.get(
'PRODUCTION_DATABASE_URI') or 'postgresql://postgres:inn_time_db_password@db:5432/inn_time'