Fixed environment variables without .env file
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Administrator 2023-03-15 13:54:06 +01:00
parent ba806ec67f
commit 4e06d454b2

View File

@ -1,17 +1,16 @@
from beanie import init_beanie from beanie import init_beanie
from motor.motor_asyncio import AsyncIOMotorClient from motor.motor_asyncio import AsyncIOMotorClient
from pydantic import BaseSettings from pydantic import BaseSettings, Field
from typing import Literal
from models.request import Request from models.request import Request
class Settings(BaseSettings): class Settings(BaseSettings):
DATABASE_URL: str DATABASE_URL: str = Field(..., env="DATABASE_URL")
AZURE_KEY: str AZURE_KEY: str = Field(..., env="AZURE_KEY")
AZURE_ENDPOINT: str AZURE_ENDPOINT: str = Field(..., env="AZURE_ENDPOINT")
AZURE_LOCATION: str AZURE_LOCATION: str = Field(..., env="AZURE_LOCATION")
ENV: Literal["dev", "prod"] ENV: str = Field(..., env="ENV")
class Config: class Config:
env_file = ".env" env_file = ".env"