forked from RDOGS-Friendz/fds-be
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
35 lines (25 loc) · 872 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
import os
from datetime import datetime, timedelta
from dotenv import dotenv_values
env_values = {
**dotenv_values(".env"),
**os.environ,
}
class DBConfig:
host = env_values.get('PG_HOST')
port = env_values.get('PG_PORT')
username = env_values.get('PG_USERNAME')
password = env_values.get('PG_PASSWORD')
db_name = env_values.get('PG_DBNAME')
db_url = env_values.get('PG_DBURL')
class AppConfig:
title = env_values.get('APP_TITLE')
docs_url = env_values.get('APP_DOCS_URL')
redoc_url = env_values.get('APP_REDOC_URL')
class JWTConfig:
jwt_secret = env_values.get('JWT_SECRET', 'aaa')
jwt_encode_algorithm = env_values.get('JWT_ENCODE_ALGORITHM', 'HS256')
login_expire = timedelta(days=float(env_values.get('LOGIN_EXPIRE_DAYS', '7')))
db_config = DBConfig()
app_config = AppConfig()
jwt_config = JWTConfig()