-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
53 lines (40 loc) · 1.46 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
import secrets
from typing import List
from pydantic import BaseSettings, AnyHttpUrl, EmailStr
class Settings(BaseSettings):
API_V1_STR: str = "/api/v1"
# SECRET_KEY for JWT token generation
# Calling secrets.token_urlsafe will generate a new secret everytime
# the server restarts, which can be quite annoying when developing, where
# a stable SECRET_KEY is prefered.
# SECRET_KEY: str = secrets.token_urlsafe(32)
SECRET_KEY: str = "temporarysecretkey"
# database configurations
MONGO_HOST: str
MONGO_PORT: int
MONGO_USER: str
MONGO_PASSWORD: str
MONGO_DB: str
# 60 minutes * 24 hours * 8 days = 8 days
ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 8
SERVER_NAME: str
SERVER_HOST: AnyHttpUrl
# BACKEND_CORS_ORIGINS is a JSON-formatted list of origins
# e.g: '["http://localhost", "http://localhost:4200", "http://localhost:3000", \
# "http://localhost:8080", "http://local.dockertoolbox.tiangolo.com"]'
BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = []
PROJECT_NAME: str
FIRST_SUPERUSER: EmailStr
FIRST_SUPERUSER_PASSWORD: str
ROUTE_IMG_DATA_DIR: str
# SSO ID and Secrets
GOOGLE_CLIENT_ID: str = None
GOOGLE_CLIENT_SECRET: str = None
FACEBOOK_CLIENT_ID: str = None
FACEBOOK_CLIENT_SECRET: str = None
SSO_CALLBACK_HOSTNAME: str = None
SSO_LOGIN_CALLBACK_URL: str = None
class Config:
env_file = ".env.dev"
# orm_mode = True
settings = Settings()