· 6 years ago · Jun 13, 2019, 12:50 PM
1class AppSettings(BaseSettings):
2 project_name: Optional[str]
3 debug: bool = False
4 include_admin_routes: bool = False
5
6 # Server
7 server_name: Optional[str]
8 server_host: Optional[str]
9 sentry_dsn: Optional[str]
10 backend_cors_origins_str: str = "" # Should be a comma-separated list of origins
11 secret_key: bytes = os.urandom(32)
12
13 # URLs
14 api_v1_str: str = "/api/v1"
15 openapi_url: str = "/api/v1/openapi.json"
16
17 # Database
18 postgres_server: Optional[str]
19 postgres_user: Optional[str]
20 postgres_password: Optional[str]
21 postgres_db: Optional[str]
22
23 ...
24
25 class Config:
26 env_prefix = "" # defaults to 'APP_'
27settings = AppSettings()