doonas4728
@doonas4728
Reviews Written
2
Average Rating
5.0
Posts
Q&A
์คํ์ ํ์์๋ ์ฐ๊ฒฐ์ด ์๋๋ ๊ฒฝ์ฐ๋ ์ด๋ป๊ฒ ํด์ผํ ๊น์
๋ช๋ฒ ์๋ํ๋ค๊ฐ ๋ฐฉ๋ฒ์ ์ฐพ์๋๋ฐ ์ด์ ๋ฅผ ๋ชฐ๋ผ ๋๊ธ์ ์ถ๊ฐ์ ์ผ๋ก ๋จ๊น๋๋ค..127.0.0.1๋ก ํด์ ์๋๊ธฐ์ ํน์ ๋ชฐ๋ผ localhost๋ก ์ง์นญ์ ๋ฐ๊ฟ ์งํ์ ํด๋ณด๋ ์ฐ๊ฒฐ์ด ๋์์ต๋๋ค;;if __name__ == "__main__": uvicorn.run(app, host="localhost",port=8000)(์ฌ์ง)์ ๊ฐ ์๊ธฐ๋ก 'localhost'์ '127.0.0.1' 2๊ฐ์ ์ฐจ์ด์ ์ด ๊ทธ๋ฅ ํํ์ ์ฐจ์ด๋ก ์๋๋ฐ ์ ์ด๋ ๊ฒ ๋๋์ง ์ด์ ๋ฅผ ๋ชจ๋ฅด๊ฒ ๋ค์;;
- 1
- 4
- 895
Q&A
์คํ์ ํ์์๋ ์ฐ๊ฒฐ์ด ์๋๋ ๊ฒฝ์ฐ๋ ์ด๋ป๊ฒ ํด์ผํ ๊น์
import uvicorn from typing import Union from fastapi import FastAPI app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} if __name__ == "__main__": uvicorn.run(app, host="127.0.0.1",port=8000)์ฝ๋๋ ๊ฐ์์ ๋์ผํฉ๋๋ค.Python 3.12.2๋ก ๋ฒ์ ๋ ๋์ผํ์ง๋ง๊ตณ์ด ์ฐจ์ด๋ฅผ ์ฐพ์๋ฉด PostgreSQL๋ฒ์ ์ด ๋ค๋ฅด๋ค๋ ์ ..?๋ฐฉ๋ฒ์ ์ฐพ์๋ณด๋๋ฐ ์ ์ํ๋ ค ๊ธ ๋จ๊น๋๋ค.
- 1
- 4
- 895




