Skip to content

Commit f2d038b

Browse files
committed
updates
1 parent 0e91261 commit f2d038b

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

app/__main__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import granian
22
from granian.constants import Interfaces, Loops
3+
from granian.log import LogLevels
34

45
from app.settings import settings
56

@@ -10,6 +11,6 @@
1011
address="0.0.0.0", # noqa: S104
1112
port=settings.app_port,
1213
interface=Interfaces.ASGI,
13-
log_level=settings.log_level,
14+
log_level=LogLevels(settings.log_level),
1415
loop=Loops.uvloop,
1516
).serve()

app/settings.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import pydantic
21
import pydantic_settings
3-
from granian.log import LogLevels
42
from sqlalchemy.engine.url import URL
53

64

@@ -9,7 +7,7 @@ class Settings(pydantic_settings.BaseSettings):
97
service_version: str = "1.0.0"
108
service_environment: str = "local"
119
service_debug: bool = False
12-
log_level: LogLevels = LogLevels.info
10+
log_level: str = "info"
1311

1412
db_driver: str = "postgresql+asyncpg"
1513
db_host: str = "db"
@@ -30,14 +28,10 @@ class Settings(pydantic_settings.BaseSettings):
3028
logging_buffer_capacity: int = 0
3129
swagger_offline_docs: bool = True
3230

33-
cors_allowed_origins: list[str] = pydantic.Field(
34-
default_factory=lambda: [
35-
"http://localhost:5173",
36-
]
37-
)
38-
cors_allowed_methods: list[str] = pydantic.Field(default_factory=lambda: [""])
39-
cors_allowed_headers: list[str] = pydantic.Field(default_factory=lambda: [""])
40-
cors_exposed_headers: list[str] = pydantic.Field(default_factory=list)
31+
cors_allowed_origins: list[str] = ["http://localhost:5173"]
32+
cors_allowed_methods: list[str] = [""]
33+
cors_allowed_headers: list[str] = [""]
34+
cors_exposed_headers: list[str] = []
4135

4236
@property
4337
def db_dsn(self) -> URL:

uv.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)