{"id":38432,"date":"2024-11-01T18:16:54","date_gmt":"2024-11-01T18:16:54","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38432"},"modified":"2024-11-26T06:44:21","modified_gmt":"2024-11-26T06:44:21","slug":"fastapi-%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c-%ec%9d%b4%eb%b2%a4%ed%8a%b8-%eb%ac%b8%ec%84%9c-%ed%81%b4%eb%9e%98%ec%8a%a4%ec%99%80-%eb%9d%bc%ec%9a%b0%ed%8a%b8-%eb%b3%80%ea%b2%bd","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38432\/","title":{"rendered":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd"},"content":{"rendered":"<p><body><\/p>\n<article>\n<header>\n<p>\uc791\uc131\uc790: \uc870\uad11\ud615<\/p>\n<p>\ub0a0\uc9dc: 2024\ub144 11\uc6d4 26\uc77c<\/p>\n<\/header>\n<section>\n<h2>1. FastAPI\ub780?<\/h2>\n<p>FastAPI\ub294 Python\uc758 \ube44\ub3d9\uae30 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, API \uc11c\ubc84\ub97c \uac1c\ubc1c\ud558\ub294 \ub370 \ucd5c\uc801\ud654\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. Python\uc758 \ud0c0\uc785 \ud78c\ud2b8\ub97c \ud65c\uc6a9\ud558\uc5ec \uac15\ub825\ud55c \ub370\uc774\ud130 \uac80\uc99d \ubc0f \ubb38\uc11c\ud654 \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\ub294 \uc2a4\ud0c0\ud2b8\uc5c5\uc5d0\uc11c \ub300\uaddc\ubaa8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0 \uc774\ub974\uae30\uae4c\uc9c0 \ub2e4\uc591\ud55c \ud504\ub85c\uc81d\ud2b8\uc5d0 \uc801\ud569\ud558\uba70, OpenAPI\uc640 JSON Schema\ub97c \uc9c0\uc6d0\ud558\uc5ec \uc790\ub3d9\uc73c\ub85c API \ubb38\uc11c\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ud2b9\uc9d5 \ub355\ubd84\uc5d0 FastAPI\ub294 \ud6a8\uc728\uc801\uc774\uace0 \uba85\ud655\ud55c API \uc11c\ubc84 \uac1c\ubc1c\uc744 \uac00\ub2a5\ud558\uac8c \ud569\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>2. FastAPI \uc124\uce58<\/h2>\n<p>FastAPI\ub294 pip\ub97c \uc0ac\uc6a9\ud558\uc5ec \uac04\ud3b8\ud558\uac8c \uc124\uce58\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud504\ub85c\uc81d\ud2b8\ub97c \uc2dc\uc791\ud558\uae30 \uc704\ud574 \uac00\uc0c1 \ud658\uacbd\uc744 \uc124\uc815\ud558\uace0 FastAPI\uc640 Uvicorn(ASGI \uc11c\ubc84)\uc744 \uc124\uce58\ud558\ub294 \ubc29\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>bash\n# \uac00\uc0c1 \ud658\uacbd \uc124\uc815\npython -m venv venv\nsource venv\/bin\/activate  # \ub9ac\ub205\uc2a4\/Mac\nvenv\\Scripts\\activate  # \uc708\ub3c4\uc6b0\n\n# FastAPI\uc640 Uvicorn \uc124\uce58\npip install fastapi uvicorn\n            <\/code><\/pre>\n<p>\uc774\uc81c FastAPI\ub97c \uc0ac\uc6a9\ud560 \uc900\ube44\uac00 \ub418\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>3. \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\ub780?<\/h2>\n<p>\uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\ub294 \ud2b9\uc815 \uc774\ubca4\ud2b8\uc5d0 \ub300\ud55c \uc815\ubcf4\ub97c \ub2f4\uace0 \uc788\ub294 \ub370\uc774\ud130 \ubaa8\ub378\uc744 \uc815\uc758\ud569\ub2c8\ub2e4. FastAPI\ub294 Pydantic\uc744 \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130 \ubaa8\ub378\uc744 \uc815\uc758\ud558\uace0 \uac80\uc99d\ud569\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, \uc774\ubca4\ud2b8\uc758 \uc81c\ubaa9, \uc124\uba85, \ubc1c\uc0dd \uc77c\uc2dc \ub4f1\uc744 \ud3ec\ud568\ud558\ub294 \uc774\ubca4\ud2b8 \ubaa8\ub378\uc744 \ub9cc\ub4e4\uc5b4 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>python\nfrom pydantic import BaseModel\nfrom datetime import datetime\n\nclass Event(BaseModel):\n    title: str\n    description: str\n    event_date: datetime\n    location: str\n            <\/code><\/pre>\n<p>\uc774\ubca4\ud2b8 \ubaa8\ub378\uc740 FastAPI\uc758 \uc694\uccad \ubc0f \uc751\ub2f5 \ubcf8\ubb38\uc5d0\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774 \ubaa8\ub378\uc744 \ud65c\uc6a9\ud558\uba74 API\uc5d0\uc11c \uc218\uc2e0\ub418\ub294 \ub370\uc774\ud130\uc758 \uc720\ud6a8\uc131\uc744 \uac80\uc0ac\ud558\uace0, \uc790\ub3d9\uc73c\ub85c \ubb38\uc11c\ud654\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>4. FastAPI \ub77c\uc6b0\ud2b8 \uc124\uc815<\/h2>\n<p>\ub77c\uc6b0\ud2b8\ub294 HTTP \uc694\uccad\uc5d0 \ub300\ud55c \ud578\ub4e4\ub7ec \uc5ed\ud560\uc744 \ud569\ub2c8\ub2e4. FastAPI\uc5d0\uc11c \ub77c\uc6b0\ud2b8\ub97c \uc124\uc815\ud558\ub824\uba74 \uc778\uc2a4\ud134\uc2a4\ub97c \uc0dd\uc131\ud55c \ud6c4 \ub370\ucf54\ub808\uc774\ud130\ub97c \uc0ac\uc6a9\ud558\uc5ec \uacbd\ub85c\ub97c \uc815\uc758\ud569\ub2c8\ub2e4. \ub2e4\uc74c\uc740 \uae30\ubcf8\uc801\uc778 FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ubc0f \uc774\ubca4\ud2b8 \ubaa8\ub378\uc744 \ud65c\uc6a9\ud55c API \ub77c\uc6b0\ud2b8 \uc124\uc815 \uc608\uc81c\uc785\ub2c8\ub2e4.<\/p>\n<pre><code>python\nfrom fastapi import FastAPI\nfrom typing import List\n\napp = FastAPI()\n\n# \uc774\ubca4\ud2b8 \ub9ac\uc2a4\ud2b8\nevents: List[Event] = []\n\n# \uc774\ubca4\ud2b8 \uc0dd\uc131\n@app.post(\"\/events\/\", response_model=Event)\nasync def create_event(event: Event):\n    events.append(event)\n    return event\n\n# \ubaa8\ub4e0 \uc774\ubca4\ud2b8 \uc870\ud68c\n@app.get(\"\/events\/\", response_model=List[Event])\nasync def get_events():\n    return events\n            <\/code><\/pre>\n<p>\uc704 \ucf54\ub4dc\ub294 \uc774\ubca4\ud2b8\ub97c \uc0dd\uc131\ud558\ub294 POST \uc694\uccad\uacfc \ubaa8\ub4e0 \uc774\ubca4\ud2b8\ub97c \uc870\ud68c\ud558\ub294 GET \uc694\uccad\uc744 \ucc98\ub9ac\ud569\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>5. \ub77c\uc6b0\ud2b8 \ubcc0\uacbd \ubc0f \ucd94\uac00 \uae30\ub2a5 \uad6c\ud604<\/h2>\n<p>\uc774\uc81c \uae30\ubcf8\uc801\uc778 CRUD(Create, Read, Update, Delete) \uae30\ub2a5\uc744 \uac16\ucd98 \uc774\ubca4\ud2b8 API\ub97c \ud655\uc7a5\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc5ec\uae30\uc11c\ub294 \uc774\ubca4\ud2b8 \uc5c5\ub370\uc774\ud2b8 \ubc0f \uc0ad\uc81c \uae30\ub2a5\uc744 \ucd94\uac00\ud558\ub294 \ubc29\ubc95\uc744 \uc124\uba85\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>python\nfrom fastapi import HTTPException\n\n# \uc774\ubca4\ud2b8 \uc5c5\ub370\uc774\ud2b8\n@app.put(\"\/events\/{event_id}\", response_model=Event)\nasync def update_event(event_id: int, updated_event: Event):\n    if event_id &lt; 0 or event_id &gt;= len(events):\n        raise HTTPException(status_code=404, detail=\"Event not found\")\n    events[event_id] = updated_event\n    return updated_event\n\n# \uc774\ubca4\ud2b8 \uc0ad\uc81c\n@app.delete(\"\/events\/{event_id}\", response_model=Event)\nasync def delete_event(event_id: int):\n    if event_id &lt; 0 or event_id &gt;= len(events):\n        raise HTTPException(status_code=404, detail=\"Event not found\")\n    deleted_event = events.pop(event_id)\n    return deleted_event\n            <\/code><\/pre>\n<p>\uc774 \ucf54\ub4dc\ub294 \uc774\ubca4\ud2b8\ub97c \uc5c5\ub370\uc774\ud2b8\ud558\ub294 PUT \uc694\uccad\uacfc \uc0ad\uc81c\ud558\ub294 DELETE \uc694\uccad\uc744 \ucc98\ub9ac\ud569\ub2c8\ub2e4. \uac01\uac01\uc758 \uc694\uccad\uc740 \uc774\ubca4\ud2b8\uc758 ID\ub97c \uacbd\ub85c \ub9e4\uac1c\ubcc0\uc218\ub85c \uc0ac\uc6a9\ud558\uc5ec \ud2b9\uc815 \uc774\ubca4\ud2b8\ub97c \uad00\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \ud569\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>6. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640\uc758 \ud1b5\ud569<\/h2>\n<p>FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc740 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \uc27d\uac8c \ud1b5\ud569\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. SQLAlchemy\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640\uc758 \uc0c1\ud638\uc791\uc6a9\uc744 \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ub2e4\uc74c\uc740 SQLite \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \uc5f0\uacb0\ud558\uace0 \uc774\ubca4\ud2b8 \ubaa8\ub378\uc744 \uc800\uc7a5\ud558\uace0 \uac00\uc838\uc624\ub294 \ubc29\ubc95\uc758 \uc608\uc2dc\uc785\ub2c8\ub2e4.<\/p>\n<pre><code>python\nfrom sqlalchemy import Column, Integer, String, DateTime\nfrom sqlalchemy.ext.declarative import declarative_base\nfrom sqlalchemy.orm import sessionmaker\nfrom sqlalchemy import create_engine\n\nBase = declarative_base()\n\nclass EventORM(Base):\n    __tablename__ = \"events\"\n    id = Column(Integer, primary_key=True, index=True)\n    title = Column(String)\n    description = Column(String)\n    event_date = Column(DateTime)\n    location = Column(String)\n\n# SQLite \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\uacb0\nengine = create_engine(\"sqlite:\/\/\/.\/events.db\")\nBase.metadata.create_all(bind=engine)\n\nSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)\n\n# FastAPI \ub77c\uc6b0\ud2b8\uc5d0\uc11c \uc0ac\uc6a9\n@app.post(\"\/events\/\", response_model=Event)\nasync def create_event(event: Event):\n    db = SessionLocal()\n    db_event = EventORM(**event.dict())\n    db.add(db_event)\n    db.commit()\n    db.refresh(db_event)\n    db.close()\n    return db_event\n            <\/code><\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\ub294 SQLite \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \uc774\ubca4\ud2b8 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\ub294 \ubc29\ubc95\uc744 \ubcf4\uc5ec\uc90d\ub2c8\ub2e4. SQLAlchemy\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\uacb0\uacfc ORM(Object-Relational Mapping) \uc124\uc815\uc744 \ud558\uc600\uc2b5\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>7. \ube44\ub3d9\uae30 \uc791\uc5c5 \ubc0f \uc131\ub2a5 \ucd5c\uc801\ud654<\/h2>\n<p>FastAPI\ub294 \ube44\ub3d9\uae30 \uc791\uc5c5\uc744 \uc27d\uac8c \ucc98\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \uc124\uacc4\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc791\uc5c5\uc744 \ube44\ub3d9\uae30\ub85c \ucc98\ub9ac\ud558\uba74, \uc131\ub2a5\uc744 \ub354\uc6b1 \ud5a5\uc0c1\uc2dc\ud0ac \uc218 \uc788\uc2b5\ub2c8\ub2e4. SQLAlchemy\uc758 \ube44\ub3d9\uae30 \uae30\ub2a5\uc744 \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>python\nfrom sqlalchemy.ext.asyncio import AsyncSession, create_async_engine\nfrom sqlalchemy.ext.declarative import declarative_base\nfrom sqlalchemy.orm import sessionmaker\n\nBase = declarative_base()\nDATABASE_URL = \"sqlite+aiosqlite:\/\/\/.\/events.db\"\n\n# \ube44\ub3d9\uae30 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5d4\uc9c4\nasync_engine = create_async_engine(DATABASE_URL, echo=True)\nAsyncSessionLocal = sessionmaker(async_engine, expire_on_commit=False, class_=AsyncSession)\n\n@app.post(\"\/events\/\", response_model=Event)\nasync def create_event(event: Event):\n    async with AsyncSessionLocal() as session:\n        db_event = EventORM(**event.dict())\n        session.add(db_event)\n        await session.commit()\n        await session.refresh(db_event)\n        return db_event\n            <\/code><\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\ub294 \ube44\ub3d9\uae30 \uc138\uc158\uc744 \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \uc774\ubca4\ud2b8\ub97c \uc800\uc7a5\ud558\ub294 \ubc29\ubc95\uc744 \ubcf4\uc5ec\uc90d\ub2c8\ub2e4. \uc131\ub2a5 \ud5a5\uc0c1\uc744 \uc704\ud574 \ube44\ub3d9\uae30 \uc791\uc5c5\uc744 \ud65c\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>8. API \ubb38\uc11c\ud654<\/h2>\n<p>FastAPI\uc758 \uac15\ub825\ud55c \uae30\ub2a5 \uc911 \ud558\ub098\ub294 \uc790\ub3d9\uc73c\ub85c API \ubb38\uc11c\ub97c \uc0dd\uc131\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. Swagger UI\uc640 ReDoc\uc744 \uae30\ubcf8\uc801\uc73c\ub85c \uc9c0\uc6d0\ud558\uc5ec, \uc791\uc131\ud55c API\ub97c \uc27d\uac8c \ubb38\uc11c\ud654\ud558\uace0 \ud14c\uc2a4\ud2b8\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc2e4\ud589\ud55c \ud6c4 <code>http:\/\/localhost:8000\/docs<\/code> \ub610\ub294 <code>http:\/\/localhost:8000\/redoc<\/code>\uc5d0 \uc811\uc18d\ud558\uc5ec \ubb38\uc11c\ub97c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>9. \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uc2e4\ud589\ud558\uae30<\/h2>\n<p>FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc2e4\ud589\ud558\ub824\uba74, Uvicorn\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc11c\ubc84\ub97c \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc544\ub798 \uba85\ub839\uc5b4\ub97c \ud1b5\ud574 FastAPI \uc11c\ubc84\ub97c \uc2e4\ud589\ud558\uc138\uc694.<\/p>\n<pre><code>bash\nuvicorn main:app --reload\n            <\/code><\/pre>\n<p>\uc5ec\uae30\uc11c <code>main<\/code>\uc740 Python \ud30c\uc77c\uc758 \uc774\ub984\uc774\uba70, <code>app<\/code>\ub294 FastAPI \uc778\uc2a4\ud134\uc2a4\uc758 \uc774\ub984\uc785\ub2c8\ub2e4. <code>--reload<\/code> \uc635\uc158\uc744 \uc0ac\uc6a9\ud558\uba74 \ucf54\ub4dc \ubcc0\uacbd \uc2dc \uc790\ub3d9\uc73c\ub85c \uc11c\ubc84\uac00 \uc7ac\uc2dc\uc791\ub429\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>10. \uacb0\ub860<\/h2>\n<p>\uc774\ubc88 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\ub97c \uc815\uc758\ud558\uace0, \ub2e4\uc591\ud55c \ub77c\uc6b0\ud2b8\ub97c \uc124\uc815\ud558\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uc558\uc2b5\ub2c8\ub2e4. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640\uc758 \ud1b5\ud569 \ubc0f \ube44\ub3d9\uae30 \uc791\uc5c5\uc744 \ud1b5\ud574 \ub354 \ub098\uc544\uac00 \uc131\ub2a5 \ucd5c\uc801\ud654 \ubc29\ubc95\uae4c\uc9c0 \uc54c\uc544\ubcf4\uc558\uc2b5\ub2c8\ub2e4. FastAPI\uc758 \uc720\uc6a9\ud55c \uae30\ub2a5\ub4e4\uc744 \ud65c\uc6a9\ud558\uc5ec \uac15\ub825\ud558\uace0 \uc720\uc5f0\ud55c API \uc11c\ubc84\ub97c \uad6c\ucd95\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<\/section>\n<footer>\n<p>\uc774 \uae00\uc5d0\uc11c \uc18c\uac1c\ud55c \ub0b4\uc6a9\uc774 FastAPI\ub97c \uc774\ud574\ud558\uace0 \ud65c\uc6a9\ud558\ub294 \ub370 \ub3c4\uc6c0\uc774 \ub418\uc5c8\uae38 \ubc14\ub78d\ub2c8\ub2e4. FastAPI\uc758 \ub2e4\uc591\ud55c \uae30\ub2a5\uc744 \uc2e4\ud5d8\ud558\uace0, \uc5ec\ub7ec\ubd84\ub9cc\uc758 \ud765\ubbf8\ub85c\uc6b4 \ud504\ub85c\uc81d\ud2b8\ub97c \ub9cc\ub4e4\uc5b4\ubcf4\uc138\uc694!<\/p>\n<\/footer>\n<\/article>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc791\uc131\uc790: \uc870\uad11\ud615 \ub0a0\uc9dc: 2024\ub144 11\uc6d4 26\uc77c 1. FastAPI\ub780? FastAPI\ub294 Python\uc758 \ube44\ub3d9\uae30 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, API \uc11c\ubc84\ub97c \uac1c\ubc1c\ud558\ub294 \ub370 \ucd5c\uc801\ud654\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. Python\uc758 \ud0c0\uc785 \ud78c\ud2b8\ub97c \ud65c\uc6a9\ud558\uc5ec \uac15\ub825\ud55c \ub370\uc774\ud130 \uac80\uc99d \ubc0f \ubb38\uc11c\ud654 \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\ub294 \uc2a4\ud0c0\ud2b8\uc5c5\uc5d0\uc11c \ub300\uaddc\ubaa8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0 \uc774\ub974\uae30\uae4c\uc9c0 \ub2e4\uc591\ud55c \ud504\ub85c\uc81d\ud2b8\uc5d0 \uc801\ud569\ud558\uba70, OpenAPI\uc640 JSON Schema\ub97c \uc9c0\uc6d0\ud558\uc5ec \uc790\ub3d9\uc73c\ub85c API \ubb38\uc11c\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ud2b9\uc9d5 \ub355\ubd84\uc5d0 FastAPI\ub294 \ud6a8\uc728\uc801\uc774\uace0 \uba85\ud655\ud55c API \uc11c\ubc84 \uac1c\ubc1c\uc744 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38432\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[183],"tags":[],"class_list":["post-38432","post","type-post","status-publish","format-standard","hentry","category-fastapi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/38432\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"\uc791\uc131\uc790: \uc870\uad11\ud615 \ub0a0\uc9dc: 2024\ub144 11\uc6d4 26\uc77c 1. FastAPI\ub780? FastAPI\ub294 Python\uc758 \ube44\ub3d9\uae30 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, API \uc11c\ubc84\ub97c \uac1c\ubc1c\ud558\ub294 \ub370 \ucd5c\uc801\ud654\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. Python\uc758 \ud0c0\uc785 \ud78c\ud2b8\ub97c \ud65c\uc6a9\ud558\uc5ec \uac15\ub825\ud55c \ub370\uc774\ud130 \uac80\uc99d \ubc0f \ubb38\uc11c\ud654 \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\ub294 \uc2a4\ud0c0\ud2b8\uc5c5\uc5d0\uc11c \ub300\uaddc\ubaa8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0 \uc774\ub974\uae30\uae4c\uc9c0 \ub2e4\uc591\ud55c \ud504\ub85c\uc81d\ud2b8\uc5d0 \uc801\ud569\ud558\uba70, OpenAPI\uc640 JSON Schema\ub97c \uc9c0\uc6d0\ud558\uc5ec \uc790\ub3d9\uc73c\ub85c API \ubb38\uc11c\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ud2b9\uc9d5 \ub355\ubd84\uc5d0 FastAPI\ub294 \ud6a8\uc728\uc801\uc774\uace0 \uba85\ud655\ud55c API \uc11c\ubc84 \uac1c\ubc1c\uc744 &hellip; \ub354 \ubcf4\uae30 &quot;FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38432\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T18:16:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:44:21+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/38432\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38432\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd\",\"datePublished\":\"2024-11-01T18:16:54+00:00\",\"dateModified\":\"2024-11-26T06:44:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38432\/\"},\"wordCount\":68,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"FastAPI\uc11c\ubc84\uac1c\ubc1c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/38432\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38432\/\",\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T18:16:54+00:00\",\"dateModified\":\"2024-11-26T06:44:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38432\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38432\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38432\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/38432\/","og_locale":"ko_KR","og_type":"article","og_title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"\uc791\uc131\uc790: \uc870\uad11\ud615 \ub0a0\uc9dc: 2024\ub144 11\uc6d4 26\uc77c 1. FastAPI\ub780? FastAPI\ub294 Python\uc758 \ube44\ub3d9\uae30 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, API \uc11c\ubc84\ub97c \uac1c\ubc1c\ud558\ub294 \ub370 \ucd5c\uc801\ud654\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. Python\uc758 \ud0c0\uc785 \ud78c\ud2b8\ub97c \ud65c\uc6a9\ud558\uc5ec \uac15\ub825\ud55c \ub370\uc774\ud130 \uac80\uc99d \ubc0f \ubb38\uc11c\ud654 \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\ub294 \uc2a4\ud0c0\ud2b8\uc5c5\uc5d0\uc11c \ub300\uaddc\ubaa8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0 \uc774\ub974\uae30\uae4c\uc9c0 \ub2e4\uc591\ud55c \ud504\ub85c\uc81d\ud2b8\uc5d0 \uc801\ud569\ud558\uba70, OpenAPI\uc640 JSON Schema\ub97c \uc9c0\uc6d0\ud558\uc5ec \uc790\ub3d9\uc73c\ub85c API \ubb38\uc11c\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ud2b9\uc9d5 \ub355\ubd84\uc5d0 FastAPI\ub294 \ud6a8\uc728\uc801\uc774\uace0 \uba85\ud655\ud55c API \uc11c\ubc84 \uac1c\ubc1c\uc744 &hellip; \ub354 \ubcf4\uae30 \"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd\"","og_url":"https:\/\/atmokpo.com\/w\/38432\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T18:16:54+00:00","article_modified_time":"2024-11-26T06:44:21+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"2\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/38432\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38432\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd","datePublished":"2024-11-01T18:16:54+00:00","dateModified":"2024-11-26T06:44:21+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38432\/"},"wordCount":68,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["FastAPI\uc11c\ubc84\uac1c\ubc1c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/38432\/","url":"https:\/\/atmokpo.com\/w\/38432\/","name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T18:16:54+00:00","dateModified":"2024-11-26T06:44:21+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38432\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38432\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38432\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=38432"}],"version-history":[{"count":2,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38432\/revisions"}],"predecessor-version":[{"id":43092,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38432\/revisions\/43092"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}