|
@ -1,21 +1,7 @@ |
|
|
from fastapi import FastAPI |
|
|
from fastapi import FastAPI |
|
|
from fastapi.middleware.cors import CORSMiddleware |
|
|
from fastapi.middleware.cors import CORSMiddleware |
|
|
from pydantic_settings import BaseSettings |
|
|
|
|
|
from pydantic import BaseModel |
|
|
|
|
|
|
|
|
from settings import Settings |
|
|
import os |
|
|
import os |
|
|
|
|
|
|
|
|
class UvicornSettings(BaseModel): |
|
|
|
|
|
host: str = "0.0.0.0" |
|
|
|
|
|
port: int = 8000 |
|
|
|
|
|
reload: bool = True |
|
|
|
|
|
|
|
|
|
|
|
class Settings(BaseSettings): |
|
|
|
|
|
DATABASE_URL: str |
|
|
|
|
|
uvicorn: UvicornSettings = UvicornSettings() |
|
|
|
|
|
class Config: |
|
|
|
|
|
env_nested_delimiter = '__' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
settings = Settings(_env_file=os.getenv("ENV", ".env")) |
|
|
settings = Settings(_env_file=os.getenv("ENV", ".env")) |
|
|
|
|
|
|
|
|
app = FastAPI() |
|
|
app = FastAPI() |
|
|