diff --git a/api/schemas/todo.py b/api/schemas/todo.py index 537a193..847d219 100644 --- a/api/schemas/todo.py +++ b/api/schemas/todo.py @@ -36,6 +36,5 @@ class TodoResponse(TodoBase): updated_at: Optional[datetime] = None class Config: - """ORM mode config for the TodoResponse schema""" - orm_mode = True + """Config for the TodoResponse schema""" from_attributes = True diff --git a/api/schemas/user.py b/api/schemas/user.py index e03a7da..1fa2888 100644 --- a/api/schemas/user.py +++ b/api/schemas/user.py @@ -35,8 +35,7 @@ class UserResponse(UserBase): updated_at: Optional[datetime] = None class Config: - """ORM mode config for the UserResponse schema""" - orm_mode = True + """Config for the UserResponse schema""" from_attributes = True diff --git a/main.py b/main.py index 1aff3b6..094d57b 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,5 @@ +import os + import uvicorn from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware @@ -32,4 +34,9 @@ async def startup(): create_tables() if __name__ == "__main__": - uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True) + # Get port from environment variable or use default of 8002 + # This avoids the conflict with port 8001 which is already in use + port = int(os.environ.get("PORT", 8002)) + host = os.environ.get("HOST", "0.0.0.0") + + uvicorn.run("main:app", host=host, port=port, reload=True)