{"id":38424,"date":"2024-11-01T18:16:48","date_gmt":"2024-11-01T18:16:48","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38424"},"modified":"2024-11-26T06:44:22","modified_gmt":"2024-11-26T06:44:22","slug":"fastapi-%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c-%ec%8a%a4%ed%82%a4%eb%a7%88-%ec%9d%91%eb%8b%b5-%ec%9d%91%eb%8b%b5-%ed%83%80%ec%9e%85-%ec%a0%95%ec%9d%98","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38424\/","title":{"rendered":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2a4\ud0a4\ub9c8 &#8211; \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758"},"content":{"rendered":"<p><body><\/p>\n<p>\n    FastAPI\ub294 \ud604\ub300\uc801\uc778 \uc6f9 API\ub97c \uad6c\ucd95\ud558\ub294 \ub370 \ucd5c\uc801\ud654\ub41c Python \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc131\ub2a5\uacfc \ube60\ub978 \uac1c\ubc1c \uc18d\ub3c4\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\uc758 \uc8fc\uc694 \uc7a5\uc810 \uc911 \ud558\ub098\ub294 \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\uc640 \uc790\ub3d9 \ubb38\uc11c \uc0dd\uc131\uc744 \uc704\ud55c <strong>Pydantic<\/strong>\uc758 \uc0ac\uc6a9\uc785\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 FastAPI\uc5d0\uc11c \uc751\ub2f5 \uc2a4\ud0a4\ub9c8\ub97c \uc815\uc758\ud558\ub294 \ubc29\ubc95\uacfc \ub2e4\uc591\ud55c \uc751\ub2f5 \ud0c0\uc785\uc744 \uc124\uc815\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uae4a\uc774 \uc788\uac8c \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h2>1. FastAPI\uc640 Pydantic \uc18c\uac1c<\/h2>\n<p>\n    FastAPI\ub294 \ubc31\uc5d4\ub4dc \uc11c\ubc84 \uac1c\ubc1c\uc744 \uc704\ud55c \uace0\uc131\ub2a5 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, RESTful API\ub97c \uac04\ud3b8\ud558\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\uac8c \ub3c4\uc640\uc90d\ub2c8\ub2e4. FastAPI\uc758 \ud575\uc2ec \ud2b9\uc9d5 \uc911 \ud558\ub098\ub294 Pydantic\uc744 \ud1b5\ud55c \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac \ubc0f \uc9c1\ub82c\ud654\uc785\ub2c8\ub2e4. Pydantic\uc744 \uc0ac\uc6a9\ud558\uba74 \ub370\uc774\ud130 \ubaa8\ub378\uc744 \uc120\uc5b8\uc801\uc73c\ub85c \uc815\uc758\ud560 \uc218 \uc788\uc73c\uba70, \ub370\uc774\ud130\uc758 \uc720\ud6a8\uc131\uc744 \uccb4\ud06c\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<p>\n    \uc608\ub97c \ub4e4\uc5b4, \uc0ac\uc6a9\uc790\uc758 \uc815\ubcf4\ub97c \ub2f4\ub294 \ub370\uc774\ud130 \ubaa8\ub378\uc744 \uc544\ub798\uc640 \uac19\uc774 \uc815\uc758\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<pre><code>from pydantic import BaseModel\n\nclass User(BaseModel):\n    id: int\n    name: str\n    email: str\n<\/code><\/pre>\n<h2>2. FastAPI\uc5d0\uc11c\uc758 \uc751\ub2f5 \uc2a4\ud0a4\ub9c8 \uc815\uc758<\/h2>\n<p>\n    FastAPI\uc5d0\uc11c API\uc758 \uc751\ub2f5\uc744 \uc815\uc758\ud558\ub824\uba74 Pydantic \ubaa8\ub378\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \uc774 \ubaa8\ub378\uc740 API\uac00 \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uac8c \ubc18\ud658\ud558\ub294 \ub370\uc774\ud130\uc758 \uad6c\uc870\ub97c \uc815\uc758\ud569\ub2c8\ub2e4. \uc774\ub807\uac8c \ud558\uba74 \uc77c\uad00\ub41c \uc751\ub2f5 \ud615\uc2dd\uc744 \ubcf4\uc7a5\ud558\uace0 \ud074\ub77c\uc774\uc5b8\ud2b8\ub294 \uc608\uce21 \uac00\ub2a5\ud55c \ubc29\uc2dd\uc73c\ub85c \ub370\uc774\ud130\ub97c \ucc98\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<p>\n    \ub2e4\uc74c\uc740 \uc0ac\uc6a9\uc790\uc758 \uc815\ubcf4\ub97c \ubc18\ud658\ud558\ub294 API \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub97c \ub9cc\ub4dc\ub294 \uc608\uc81c\uc785\ub2c8\ub2e4.\n<\/p>\n<pre><code>from fastapi import FastAPI\n\napp = FastAPI()\n\n@app.get(\"\/users\/{user_id}\", response_model=User)\nasync def get_user(user_id: int):\n    return User(id=user_id, name=\"John Doe\", email=\"johndoe@example.com\")\n<\/code><\/pre>\n<p>\n    \uc704 \ucf54\ub4dc\uc5d0\uc11c <code>response_model=User<\/code>\ub97c \uc124\uc815\ud568\uc73c\ub85c\uc368 FastAPI\ub294 \uc774 API\uac00 \ubc18\ud658\ud558\ub294 \ub370\uc774\ud130\uac00 <code>User<\/code> \ubaa8\ub378\uc758 \ud615\uc2dd\uc5d0 \ub9de\ub3c4\ub85d \uc790\ub3d9\uc73c\ub85c \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \uc218\ud589\ud569\ub2c8\ub2e4. \uadf8\ub9ac\uace0 \uc2a4\uc6e8\uac70 \ubb38\uc11c\uc5d0\uc11c\ub3c4 \uc774 \ubaa8\ub378\uc758 \uad6c\uc131 \uc815\ubcf4\ub97c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h2>3. \ubcf5\uc7a1\ud55c \uc751\ub2f5 \ubaa8\ub378 \uc815\uc758<\/h2>\n<p>\n    API\uc758 \uc751\ub2f5\uc740 \ub54c\ub85c\ub294 \ub2e8\uc21c\ud558\uc9c0 \uc54a\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc5ec\ub7ec \uac1c\uc758 \ubaa8\ub378\uc744 \ud3ec\ud568\ud55c \ubcf5\uc7a1\ud55c \uc751\ub2f5 \uad6c\uc870\ub97c \uc815\uc758\ud574\uc57c \ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, \uac8c\uc2dc\ubb3c\uacfc \uadf8\uc5d0 \ub300\ud55c \ub313\uae00\uc744 \ud3ec\ud568\ud558\ub294 \uad6c\uc870\ub97c \uc0dd\uac01\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\n<\/p>\n<pre><code>class Comment(BaseModel):\n    id: int\n    content: str\n    user_id: int\n\nclass Post(BaseModel):\n    id: int\n    title: str\n    content: str\n    comments: List[Comment]  # \ub313\uae00 \ubaa9\ub85d\n<\/code><\/pre>\n<p>\n    \uc774\ub7ec\ud55c \ubaa8\ub378\uc744 \uc0ac\uc6a9\ud558\uc5ec \uac8c\uc2dc\ubb3c \uc815\ubcf4\ub97c \ubc18\ud658\ud558\ub294 \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub97c \uc815\uc758\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<pre><code>from typing import List\n\n@app.get(\"\/posts\/{post_id}\", response_model=Post)\nasync def get_post(post_id: int):\n    comments = [Comment(id=1, content=\"Great post!\", user_id=1), \n                Comment(id=2, content=\"Thanks for sharing!\", user_id=2)]\n    return Post(id=post_id, title=\"My First Post\", content=\"This is the content.\", comments=comments)\n<\/code><\/pre>\n<h2>4. \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758\uc640 \uc790\ub3d9 \ubb38\uc11c\ud654<\/h2>\n<p>\n    FastAPI\ub294 \uc790\ub3d9\uc73c\ub85c API \ubb38\uc11c\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc704\uc758 \uc608\uc81c\uc5d0\uc11c API\uc758 \uba54\ud0c0\ub370\uc774\ud130\ub294 FastAPI\uac00 \uc790\ub3d9\uc73c\ub85c \uc0dd\uc131\ud558\uc5ec \uc2a4\uc6e8\uac70(Swagger)\uc640 ReDoc \ubb38\uc11c\ud654 \ub3c4\uad6c\uc5d0\uc11c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc751\ub2f5 \ubaa8\ub378\uc744 \uc815\uc758\ud568\uc73c\ub85c\uc368 \ud074\ub77c\uc774\uc5b8\ud2b8\ub294 API\ub97c \uc0ac\uc6a9\ud560 \ub54c \uc5b4\ub5a4 \ud615\ud0dc\uc758 \ub370\uc774\ud130\ub97c \ubc1b\uc744 \uc218 \uc788\ub294\uc9c0 \uba85\ud655\ud558\uac8c \uc54c \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<p>\n    \ub610\ud55c, FastAPI\ub294 \ucda9\ubd84\ud55c API \ubb38\uc11c\ub97c \uc790\ub3d9\uc73c\ub85c \uc81c\uacf5\ud558\ubbc0\ub85c \ud504\ub860\ud2b8\uc5d4\ub4dc \uac1c\ubc1c\uc790\uac00 \ud544\uc694\ud55c API \uc815\ubcf4\ub97c \uc27d\uac8c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc544\ub798\uc640 \uac19\uc774 \ubb38\uc11c\ud654\ub41c \ub0b4\uc6a9\uc744 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<pre><code>uvicorn main:app --reload\n<\/code><\/pre>\n<p>\n    \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c <code>http:\/\/127.0.0.1:8000\/docs<\/code>\ub97c \uc5f4\uba74 Swagger UI\ub97c \ud1b5\ud574 API\uc758 \ubaa8\ub4e0 \uc5d4\ub4dc\ud3ec\uc778\ud2b8\uc640 \uadf8 \uc751\ub2f5 \ud615\ud0dc\ub97c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h2>5. \uc751\ub2f5 \uc2dc\ub098\ub9ac\uc624: \uc131\uacf5, \uc2e4\ud328 \uc751\ub2f5<\/h2>\n<p>\n    \uc2e4\uc81c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c\ub294 \uc131\uacf5\uc801\uc778 \uc751\ub2f5\ubfd0\ub9cc \uc544\ub2c8\ub77c \uc624\ub958 \ucc98\ub9ac\ub3c4 \ud3ec\ud568\ub418\uc5b4\uc57c \ud569\ub2c8\ub2e4. FastAPI\ub294 <code>HTTPException<\/code>\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc624\ub958 \uc751\ub2f5\uc744 \uc815\uc758\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc544\ub798 \uc608\uc2dc\ub294 \uc0ac\uc6a9\uc790\uac00 \uc874\uc7ac\ud558\uc9c0 \uc54a\uc744 \uacbd\uc6b0 404 \uc624\ub958 \uc751\ub2f5\uc744 \ubc18\ud658\ud558\ub294 \ubc29\ubc95\uc744 \ubcf4\uc5ec\uc90d\ub2c8\ub2e4.\n<\/p>\n<pre><code>from fastapi import HTTPException\n\n@app.get(\"\/users\/{user_id}\", response_model=User)\nasync def get_user(user_id: int):\n    if user_id != 1:  # \uc874\uc7ac\ud558\uc9c0 \uc54a\ub294 \uc0ac\uc6a9\uc790 ID\n        raise HTTPException(status_code=404, detail=\"User not found\")\n    return User(id=user_id, name=\"John Doe\", email=\"johndoe@example.com\")\n<\/code><\/pre>\n<h3>5.1. \ucee4\uc2a4\ud140 \uc624\ub958 \uc751\ub2f5 \ubaa8\ub378<\/h3>\n<p>\n    \ub610\ud55c, \uc624\ub958 \ubc1c\uc0dd \uc2dc\uc5d0 \ubc18\ud658\ud558\ub294 \ucee4\uc2a4\ud140 \uc751\ub2f5 \ubaa8\ub378\uc744 \uc815\uc758\ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, \uc624\ub958 \uc751\ub2f5\uc744 \ub098\ud0c0\ub0b4\ub294 \ubaa8\ub378\uc744 \uc815\uc758\ud558\uace0 \uc774\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc77c\uad00\ub41c \uc624\ub958 \uba54\uc2dc\uc9c0\ub97c \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0 \uc804\ub2ec\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<pre><code>class ErrorResponse(BaseModel):\n    detail: str\n    status_code: int\n\n@app.exception_handler(HTTPException)\nasync def http_exception_handler(request: Request, exc: HTTPException):\n    return JSONResponse(\n        status_code=exc.status_code,\n        content={\"detail\": exc.detail, \"status_code\": exc.status_code},\n    )\n<\/code><\/pre>\n<p>\n    \uc704\uc640 \uac19\uc774 \uc124\uc815\ud558\uba74, \ubaa8\ub4e0 HTTPException\uc5d0 \ub300\ud574 \uc77c\uad00\ub41c \uad6c\uc870\uc758 \uc624\ub958 \uc751\ub2f5\uc744 \uc81c\uacf5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uc11c\ub294 \uc751\ub2f5\uc744 \uc27d\uac8c \ucc98\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h2>6. \uc751\ub2f5 \uc2a4\ud0a4\ub9c8\uc640 API \ubc84\uc804 \uad00\ub9ac<\/h2>\n<p>\n    API\ub97c \uc6b4\uc601\ud558\ub2e4 \ubcf4\uba74 \uc2a4\ud0a4\ub9c8\uac00 \ubcc0\uacbd\ub418\ub294 \uacbd\uc6b0\uac00 \ubc1c\uc0dd\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub97c \uc798 \uad00\ub9ac\ud558\uae30 \uc704\ud574 API \ubc84\uc804 \uad00\ub9ac\ub97c \uace0\ub824\ud574\uc57c \ud569\ub2c8\ub2e4. FastAPI\ub294 \uacbd\ub85c\uc5d0 \ubc84\uc804 \uc815\ubcf4\ub97c \ucd94\uac00\ud558\uc5ec \uc11c\ub85c \ub2e4\ub978 \ubc84\uc804\uc758 API\ub97c \ub3d9\uc2dc\uc5d0 \uc6b4\uc601\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<pre><code>app_v1 = FastAPI()\napp_v2 = FastAPI()\n\n@app_v1.get(\"\/users\/{user_id}\", response_model=User)\nasync def get_user_v1(user_id: int):\n    return User(id=user_id, name=\"John Doe\", email=\"janedoe@example.com\")\n\n@app_v2.get(\"\/users\/{user_id}\", response_model=User)\nasync def get_user_v2(user_id: int):\n    return User(id=user_id, name=\"Jane Doe\", email=\"johndoe@example.com\")\n\n# Uvicorn\uc744 \ud1b5\ud574 \uc571 \uc2e4\ud589\n# uvicorn main:app_v1 --reload\n# uvicorn main:app_v2 --reload\n<\/code><\/pre>\n<p>\n    \uc774\ub807\uac8c \uac01\uac01\uc758 \ubc84\uc804\ub9c8\ub2e4 \ub2e4\ub978 \uc751\ub2f5\uc744 \uc81c\uacf5\ud560 \uc218 \uc788\uc73c\ubbc0\ub85c, \uae30\uc874 API\ub97c \uc0ac\uc6a9\ud558\ub294 \ud074\ub77c\uc774\uc5b8\ud2b8\ub294 \uc0c8\ub85c\uc6b4 \ubcc0\ud654\uc5d0 \uc601\ud5a5\uc744 \ubc1b\uc9c0 \uc54a\uace0, \uc810\uc9c4\uc801\uc73c\ub85c \uc5c5\ub370\uc774\ud2b8\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h2>7. \uacb0\ub860<\/h2>\n<p>\n    FastAPI\ub294 \uadf8 \uc790\uccb4\uc758 \ub6f0\uc5b4\ub09c \uc131\ub2a5\uacfc \uc9c1\uad00\uc801\uc778 \ubb38\uc11c\ud654, \uc720\ud6a8\uc131 \uac80\uc0ac \uae30\ub2a5\uc73c\ub85c \uc778\ud574 \ub370\uc774\ud130 \uae30\ubc18 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud558\ub294 \ub370 \ub9e4\uc6b0 \uc720\uc6a9\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \ubcf8 \ud3ec\uc2a4\ud2b8\uc5d0\uc11c\ub294 FastAPI\uc5d0\uc11c \uc751\ub2f5 \uc2a4\ud0a4\ub9c8\ub97c \uc815\uc758\ud558\ub294 \ubc29\ubc95\uacfc \ub2e4\uc591\ud55c \uc751\ub2f5 \ud0c0\uc785 \ucc98\ub9ac \ubc29\uc2dd\uc744 \uc790\uc138\ud788 \uc0b4\ud3b4\ubcf4\uc558\uc2b5\ub2c8\ub2e4.\n<\/p>\n<p>\n    \uc2a4\ud0a4\ub9c8 \uc815\uc758\ub294 API\uc758 \uc548\uc815\uc131\uacfc \uc77c\uad00\uc131\uc744 \ubcf4\uc7a5\ud558\ub294 \ub370 \ub9e4\uc6b0 \uc911\uc694\ud558\uba70, \ud2b9\ud788 \uc5ec\ub7ec \ud074\ub77c\uc774\uc5b8\ud2b8 \uc571\uc5d0\uc11c \uc0ac\uc6a9\ud560 \ub54c \uadf8 \uc911\uc694\uc131\uc774 \ub354\uc6b1 \ub450\ub4dc\ub7ec\uc9d1\ub2c8\ub2e4. FastAPI\ub97c \ud1b5\ud574 \ube60\ub974\uace0 \ud6a8\uc728\uc801\uc73c\ub85c API\ub97c \uad6c\ucd95\ud558\uace0 \uad00\ub9ac\ud558\ub294 \ubc29\ubc95\uc744 \uc774\ud574\ud558\ub294 \ub370 \ub3c4\uc6c0\uc774 \ub418\uc5c8\uae30\ub97c \ubc14\ub78d\ub2c8\ub2e4. \uc774\uc81c \uc5ec\ub7ec\ubd84\uc740 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uac15\ub825\ud55c \ubc31\uc5d4\ub4dc \uc2dc\uc2a4\ud15c\uc744 \uad6c\ucd95\ud560 \uc900\ube44\uac00 \ub418\uc5c8\uc2b5\ub2c8\ub2e4!\n<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>FastAPI\ub294 \ud604\ub300\uc801\uc778 \uc6f9 API\ub97c \uad6c\ucd95\ud558\ub294 \ub370 \ucd5c\uc801\ud654\ub41c Python \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc131\ub2a5\uacfc \ube60\ub978 \uac1c\ubc1c \uc18d\ub3c4\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\uc758 \uc8fc\uc694 \uc7a5\uc810 \uc911 \ud558\ub098\ub294 \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\uc640 \uc790\ub3d9 \ubb38\uc11c \uc0dd\uc131\uc744 \uc704\ud55c Pydantic\uc758 \uc0ac\uc6a9\uc785\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 FastAPI\uc5d0\uc11c \uc751\ub2f5 \uc2a4\ud0a4\ub9c8\ub97c \uc815\uc758\ud558\ub294 \ubc29\ubc95\uacfc \ub2e4\uc591\ud55c \uc751\ub2f5 \ud0c0\uc785\uc744 \uc124\uc815\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uae4a\uc774 \uc788\uac8c \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI\uc640 Pydantic \uc18c\uac1c FastAPI\ub294 \ubc31\uc5d4\ub4dc \uc11c\ubc84 \uac1c\ubc1c\uc744 \uc704\ud55c \uace0\uc131\ub2a5 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38424\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2a4\ud0a4\ub9c8 &#8211; \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758&#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-38424","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, \uc2a4\ud0a4\ub9c8 - \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758 - \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\/38424\/\" \/>\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, \uc2a4\ud0a4\ub9c8 - \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"FastAPI\ub294 \ud604\ub300\uc801\uc778 \uc6f9 API\ub97c \uad6c\ucd95\ud558\ub294 \ub370 \ucd5c\uc801\ud654\ub41c Python \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc131\ub2a5\uacfc \ube60\ub978 \uac1c\ubc1c \uc18d\ub3c4\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\uc758 \uc8fc\uc694 \uc7a5\uc810 \uc911 \ud558\ub098\ub294 \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\uc640 \uc790\ub3d9 \ubb38\uc11c \uc0dd\uc131\uc744 \uc704\ud55c Pydantic\uc758 \uc0ac\uc6a9\uc785\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 FastAPI\uc5d0\uc11c \uc751\ub2f5 \uc2a4\ud0a4\ub9c8\ub97c \uc815\uc758\ud558\ub294 \ubc29\ubc95\uacfc \ub2e4\uc591\ud55c \uc751\ub2f5 \ud0c0\uc785\uc744 \uc124\uc815\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uae4a\uc774 \uc788\uac8c \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI\uc640 Pydantic \uc18c\uac1c FastAPI\ub294 \ubc31\uc5d4\ub4dc \uc11c\ubc84 \uac1c\ubc1c\uc744 \uc704\ud55c \uace0\uc131\ub2a5 &hellip; \ub354 \ubcf4\uae30 &quot;FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2a4\ud0a4\ub9c8 &#8211; \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38424\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T18:16:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:44:22+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\/38424\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38424\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2a4\ud0a4\ub9c8 &#8211; \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758\",\"datePublished\":\"2024-11-01T18:16:48+00:00\",\"dateModified\":\"2024-11-26T06:44:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38424\/\"},\"wordCount\":52,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"FastAPI\uc11c\ubc84\uac1c\ubc1c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/38424\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38424\/\",\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2a4\ud0a4\ub9c8 - \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T18:16:48+00:00\",\"dateModified\":\"2024-11-26T06:44:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38424\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38424\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38424\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2a4\ud0a4\ub9c8 &#8211; \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758\"}]},{\"@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, \uc2a4\ud0a4\ub9c8 - \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758 - \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\/38424\/","og_locale":"ko_KR","og_type":"article","og_title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2a4\ud0a4\ub9c8 - \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"FastAPI\ub294 \ud604\ub300\uc801\uc778 \uc6f9 API\ub97c \uad6c\ucd95\ud558\ub294 \ub370 \ucd5c\uc801\ud654\ub41c Python \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc131\ub2a5\uacfc \ube60\ub978 \uac1c\ubc1c \uc18d\ub3c4\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\uc758 \uc8fc\uc694 \uc7a5\uc810 \uc911 \ud558\ub098\ub294 \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\uc640 \uc790\ub3d9 \ubb38\uc11c \uc0dd\uc131\uc744 \uc704\ud55c Pydantic\uc758 \uc0ac\uc6a9\uc785\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 FastAPI\uc5d0\uc11c \uc751\ub2f5 \uc2a4\ud0a4\ub9c8\ub97c \uc815\uc758\ud558\ub294 \ubc29\ubc95\uacfc \ub2e4\uc591\ud55c \uc751\ub2f5 \ud0c0\uc785\uc744 \uc124\uc815\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uae4a\uc774 \uc788\uac8c \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI\uc640 Pydantic \uc18c\uac1c FastAPI\ub294 \ubc31\uc5d4\ub4dc \uc11c\ubc84 \uac1c\ubc1c\uc744 \uc704\ud55c \uace0\uc131\ub2a5 &hellip; \ub354 \ubcf4\uae30 \"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2a4\ud0a4\ub9c8 &#8211; \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758\"","og_url":"https:\/\/atmokpo.com\/w\/38424\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T18:16:48+00:00","article_modified_time":"2024-11-26T06:44:22+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\/38424\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38424\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2a4\ud0a4\ub9c8 &#8211; \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758","datePublished":"2024-11-01T18:16:48+00:00","dateModified":"2024-11-26T06:44:22+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38424\/"},"wordCount":52,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["FastAPI\uc11c\ubc84\uac1c\ubc1c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/38424\/","url":"https:\/\/atmokpo.com\/w\/38424\/","name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2a4\ud0a4\ub9c8 - \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T18:16:48+00:00","dateModified":"2024-11-26T06:44:22+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38424\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38424\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38424\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2a4\ud0a4\ub9c8 &#8211; \uc751\ub2f5, \uc751\ub2f5 \ud0c0\uc785 \uc815\uc758"}]},{"@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\/38424","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=38424"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38424\/revisions"}],"predecessor-version":[{"id":38425,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38424\/revisions\/38425"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}