{"id":38512,"date":"2024-11-01T18:17:44","date_gmt":"2024-11-01T18:17:44","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38512"},"modified":"2024-11-26T06:44:07","modified_gmt":"2024-11-26T06:44:07","slug":"fastapi-%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c-db-%ec%a1%b0%ec%9e%91-u-update","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38512\/","title":{"rendered":"FastAPI \uc11c\ubc84\uac1c\ubc1c, DB \uc870\uc791, U  Update"},"content":{"rendered":"<p><body><\/p>\n<p>\n        FastAPI\ub294 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c\uc11c, Python\uc744 \uc0ac\uc6a9\ud558\uc5ec API \uc11c\ubc84\ub97c \uc27d\uac8c \uac1c\ubc1c\ud560 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4.<br \/>\n        \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \uc0c1\ud638\uc791\uc6a9\ud558\uace0, \ud2b9\ud788 \ub370\uc774\ud130\uc758 \uc5c5\ub370\uc774\ud2b8 \uae30\ub2a5\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\n    <\/p>\n<h2>1. FastAPI\ub780?<\/h2>\n<p>\n        FastAPI\ub294 \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc744 \uc9c0\uc6d0\ud558\uba70, \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \uc704\ud574 Pydantic\uc744 \ud1b5\ud569\ud558\uc5ec \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<br \/>\n        \uc774 \ud504\ub808\uc784\uc6cc\ud06c\ub294 \uc131\ub2a5\uacfc \uac1c\ubc1c\uc18d\ub3c4\ub97c \uc911\uc2dc\ud558\uc5ec \uc124\uacc4\ub418\uc5c8\uc73c\uba70, Swagger UI\uc640 ReDoc\uc744 \uae30\ubcf8\uc801\uc73c\ub85c \uc81c\uacf5\ud558\uc5ec API \ubb38\uc11c\ub97c \uc790\ub3d9\uc73c\ub85c \uc0dd\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n    <\/p>\n<h3>1.1 FastAPI\uc758 \uc8fc\uc694 \uae30\ub2a5<\/h3>\n<ul>\n<li>\ube44\ub3d9\uae30\uc801 \ucc98\ub9ac<\/li>\n<li>\uc790\ub3d9\ud654\ub41c API \ubb38\uc11c\ud654<\/li>\n<li>\uc2e0\ub8b0\uc131 \ub192\uc740 \ub370\uc774\ud130 \uac80\uc99d<\/li>\n<li>\uc9c1\uad00\uc801\uc778 \ucf54\ub4dc \uad6c\uc870<\/li>\n<\/ul>\n<h2>2. \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc124\uc815<\/h2>\n<p>\n        FastAPI\ub294 \ub2e4\uc591\ud55c \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \uc27d\uac8c \ud1b5\ud569\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n        \uc774\ubc88 \uc608\uc81c\uc5d0\uc11c\ub294 SQLAlchemy\ub97c \uc0ac\uc6a9\ud558\uc5ec SQLite \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uad6c\ucd95\ud560 \uac83\uc785\ub2c8\ub2e4.<br \/>\n        SQLAlchemy\ub294 Python\uc5d0\uc11c \uac00\uc7a5 \uc778\uae30 \uc788\ub294 ORM(Object-Relational Mapping) \ub77c\uc774\ube0c\ub7ec\ub9ac \uc911 \ud558\ub098\uc785\ub2c8\ub2e4.\n    <\/p>\n<h3>2.1 SQLAlchemy \uc124\uce58<\/h3>\n<pre><code>pip install sqlalchemy databases<\/code><\/pre>\n<h3>2.2 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ubaa8\ub378 \uc0dd\uc131<\/h3>\n<p>\n        \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud574 \uba3c\uc800 \ub370\uc774\ud130 \ubaa8\ub378\uc744 \uc815\uc758\ud574\uc57c \ud569\ub2c8\ub2e4.<br \/>\n        \uc608\ub97c \ub4e4\uc5b4, \uac04\ub2e8\ud55c \uc0ac\uc6a9\uc790 \uc815\ubcf4\ub97c \uc800\uc7a5\ud560 \uc218 \uc788\ub294 User \ubaa8\ub378\uc744 \ub9cc\ub4e4\uc5b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\n    <\/p>\n<pre><code>\nfrom sqlalchemy import Column, Integer, String, create_engine\nfrom sqlalchemy.ext.declarative import declarative_base\nfrom sqlalchemy.orm import sessionmaker\n\nBase = declarative_base()\n\nclass User(Base):\n    __tablename__ = 'users'\n    id = Column(Integer, primary_key=True, index=True)\n    username = Column(String, unique=True, index=True)\n    email = Column(String, unique=True, index=True)\n\n# SQLite \ub370\uc774\ud130\ubca0\uc774\uc2a4 URL\nDATABASE_URL = \"sqlite:\/\/\/.\/test.db\"\n\nengine = create_engine(DATABASE_URL)\nSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)\n\n# \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ud14c\uc774\ube14 \uc0dd\uc131\nBase.metadata.create_all(bind=engine)\n    <\/code><\/pre>\n<h2>3. FastAPI \uc124\uc815 \ubc0f \ub77c\uc6b0\ud130 \uad6c\ud604<\/h2>\n<p>\n        FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc124\uc815\ud558\uace0, \uc0ac\uc6a9\uc790 \uc815\ubcf4\ub97c \uc5c5\ub370\uc774\ud2b8\ud560 \uc218 \uc788\ub294 API\uc758 \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub97c \uad6c\ud604\ud558\uaca0\uc2b5\ub2c8\ub2e4.\n    <\/p>\n<h3>3.1 FastAPI \uc124\uce58<\/h3>\n<pre><code>pip install fastapi[all]<\/code><\/pre>\n<h3>3.2 FastAPI \uc124\uacc4 \ubc0f \uc5d4\ub4dc\ud3ec\uc778\ud2b8 \uad6c\ud604<\/h3>\n<p>\n        CRUD(Create, Read, Update, Delete) \uc911 Update \uae30\ub2a5\uc744 \uc911\uc810\uc801\uc73c\ub85c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<br \/>\n        \uc544\ub798 \uc608\uc81c \ucf54\ub4dc\ub294 \uc0ac\uc6a9\uc790\uc758 \uc815\ubcf4\ub97c \uc5c5\ub370\uc774\ud2b8\ud558\ub294 API\ub97c \uad6c\ud604\ud569\ub2c8\ub2e4.\n    <\/p>\n<pre><code>\nfrom fastapi import FastAPI, HTTPException, Depends\nfrom sqlalchemy.orm import Session\n\napp = FastAPI()\n\n# \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc758\uc874\uc131 \uad00\ub9ac\ndef get_db():\n    db = SessionLocal()\n    try:\n        yield db\n    finally:\n        db.close()\n\n@app.put(\"\/users\/{user_id}\")\ndef update_user(user_id: int, username: str = None, email: str = None, db: Session = Depends(get_db)):\n    # \ud574\ub2f9 ID\uc758 \uc0ac\uc6a9\uc790 \uac80\uc0c9\n    user = db.query(User).filter(User.id == user_id).first()\n    if not user:\n        raise HTTPException(status_code=404, detail=\"User not found\")\n\n    # \uac12 \uc5c5\ub370\uc774\ud2b8\n    if username:\n        user.username = username\n    if email:\n        user.email = email\n\n    db.commit()\n    db.refresh(user)\n    \n    return {\"message\": \"User updated successfully\", \"user\": user}\n    <\/code><\/pre>\n<h2>4. \uc5c5\ub370\uc774\ud2b8 \uae30\ub2a5 \ud14c\uc2a4\ud2b8<\/h2>\n<p>\n        API\ub97c \ud14c\uc2a4\ud2b8\ud558\uae30 \uc704\ud574 Swagger UI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc5c5\ub370\uc774\ud2b8 \uc791\uc5c5\uc744 \uc218\ud589\ud569\ub2c8\ub2e4.<br \/>\n        \uc11c\ubc84\ub97c \uc2e4\ud589\ud55c \ud6c4, <code>http:\/\/127.0.0.1:8000\/docs<\/code>\uc5d0 \uc811\uadfc\ud558\uc5ec API\ub97c \ud655\uc778\ud558\uace0 \ud14c\uc2a4\ud2b8\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n    <\/p>\n<pre><code>\n# \uc11c\ubc84 \uc2e4\ud589\nif __name__ == \"__main__\":\n    import uvicorn\n    uvicorn.run(app, host=\"127.0.0.1\", port=8000)\n    <\/code><\/pre>\n<h2>5. \uacb0\ub860<\/h2>\n<p>\n        FastAPI\uc640 SQLAlchemy\ub97c \uc0ac\uc6a9\ud558\uc5ec RESTful API\ub97c \uac1c\ubc1c\ud558\uace0, \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0\uc11c \uc815\ubcf4\ub97c \uc5c5\ub370\uc774\ud2b8\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uc558\uc2b5\ub2c8\ub2e4.<br \/>\n        FastAPI\ub294 \ube60\ub978 \uc131\ub2a5\uacfc \ud3b8\ub9ac\ud55c \uac1c\ubc1c \uacbd\ud5d8\uc744 \uc81c\uacf5\ud558\uba70, \uc2e4\uc81c \ub9ce\uc740 \ud504\ub85c\uc81d\ud2b8\uc5d0\uc11c \ud65c\uc6a9\ub418\uace0 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n        \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc791\uc5c5\uc744 \uc27d\uac8c \ucc98\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \ud558\uc5ec \ud6a8\uc728\uc801\uc778 \uc11c\ubc84 \uac1c\ubc1c\uc744 \ub3c4\uc640\uc90d\ub2c8\ub2e4.\n    <\/p>\n<p>\n        \uc774 \uae00\uc5d0\uc11c \uc81c\uacf5\ud55c \uc608\uc81c\ub97c \ud1a0\ub300\ub85c \ud504\ub85c\uc81d\ud2b8\ub97c \ud655\uc7a5\ud558\uace0, \ub2e4\uc591\ud55c \uae30\ub2a5\uc744 \ucd94\uac00\ud558\uc5ec \uc790\uc2e0\ub9cc\uc758 FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4e4\uc5b4\ubcf4\uc138\uc694.<br \/>\n        FastAPI\ub294 \ub9e4\uc6b0 \uc720\uc5f0\ud558\uace0 \ud655\uc7a5\uc131\uc774 \ub6f0\uc5b4\ub09c \ud504\ub808\uc784\uc6cc\ud06c\uc774\ubbc0\ub85c, \ub2e4\uc591\ud55c \uc694\uad6c\uc0ac\ud56d\uc5d0 \ub9de\ucd94\uc5b4 \uac1c\ubc1c\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n    <\/p>\n<h2>\ucc38\uace0 \uc790\ub8cc<\/h2>\n<ul>\n<li><a href=\"https:\/\/fastapi.tiangolo.com\/\" target=\"_blank\" rel=\"noopener\">FastAPI \uacf5\uc2dd \ubb38\uc11c<\/a><\/li>\n<li><a href=\"https:\/\/docs.sqlalchemy.org\/en\/14\/\" target=\"_blank\" rel=\"noopener\">SQLAlchemy \uacf5\uc2dd \ubb38\uc11c<\/a><\/li>\n<\/ul>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>FastAPI\ub294 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c\uc11c, Python\uc744 \uc0ac\uc6a9\ud558\uc5ec API \uc11c\ubc84\ub97c \uc27d\uac8c \uac1c\ubc1c\ud560 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \uc0c1\ud638\uc791\uc6a9\ud558\uace0, \ud2b9\ud788 \ub370\uc774\ud130\uc758 \uc5c5\ub370\uc774\ud2b8 \uae30\ub2a5\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI\ub780? FastAPI\ub294 \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc744 \uc9c0\uc6d0\ud558\uba70, \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \uc704\ud574 Pydantic\uc744 \ud1b5\ud569\ud558\uc5ec \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \uc774 \ud504\ub808\uc784\uc6cc\ud06c\ub294 \uc131\ub2a5\uacfc \uac1c\ubc1c\uc18d\ub3c4\ub97c \uc911\uc2dc\ud558\uc5ec \uc124\uacc4\ub418\uc5c8\uc73c\uba70, Swagger UI\uc640 ReDoc\uc744 \uae30\ubcf8\uc801\uc73c\ub85c \uc81c\uacf5\ud558\uc5ec API \ubb38\uc11c\ub97c \uc790\ub3d9\uc73c\ub85c \uc0dd\uc131\ud560 \uc218 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38512\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;FastAPI \uc11c\ubc84\uac1c\ubc1c, DB \uc870\uc791, U  Update&#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-38512","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, DB \uc870\uc791, U Update - \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\/38512\/\" \/>\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, DB \uc870\uc791, U Update - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"FastAPI\ub294 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c\uc11c, Python\uc744 \uc0ac\uc6a9\ud558\uc5ec API \uc11c\ubc84\ub97c \uc27d\uac8c \uac1c\ubc1c\ud560 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \uc0c1\ud638\uc791\uc6a9\ud558\uace0, \ud2b9\ud788 \ub370\uc774\ud130\uc758 \uc5c5\ub370\uc774\ud2b8 \uae30\ub2a5\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI\ub780? FastAPI\ub294 \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc744 \uc9c0\uc6d0\ud558\uba70, \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \uc704\ud574 Pydantic\uc744 \ud1b5\ud569\ud558\uc5ec \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \uc774 \ud504\ub808\uc784\uc6cc\ud06c\ub294 \uc131\ub2a5\uacfc \uac1c\ubc1c\uc18d\ub3c4\ub97c \uc911\uc2dc\ud558\uc5ec \uc124\uacc4\ub418\uc5c8\uc73c\uba70, Swagger UI\uc640 ReDoc\uc744 \uae30\ubcf8\uc801\uc73c\ub85c \uc81c\uacf5\ud558\uc5ec API \ubb38\uc11c\ub97c \uc790\ub3d9\uc73c\ub85c \uc0dd\uc131\ud560 \uc218 &hellip; \ub354 \ubcf4\uae30 &quot;FastAPI \uc11c\ubc84\uac1c\ubc1c, DB \uc870\uc791, U Update&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38512\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T18:17:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:44:07+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=\"1\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/38512\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38512\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, DB \uc870\uc791, U Update\",\"datePublished\":\"2024-11-01T18:17:44+00:00\",\"dateModified\":\"2024-11-26T06:44:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38512\/\"},\"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\/38512\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38512\/\",\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, DB \uc870\uc791, U Update - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T18:17:44+00:00\",\"dateModified\":\"2024-11-26T06:44:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38512\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38512\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38512\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, DB \uc870\uc791, U Update\"}]},{\"@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, DB \uc870\uc791, U Update - \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\/38512\/","og_locale":"ko_KR","og_type":"article","og_title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, DB \uc870\uc791, U Update - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"FastAPI\ub294 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c\uc11c, Python\uc744 \uc0ac\uc6a9\ud558\uc5ec API \uc11c\ubc84\ub97c \uc27d\uac8c \uac1c\ubc1c\ud560 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \uc0c1\ud638\uc791\uc6a9\ud558\uace0, \ud2b9\ud788 \ub370\uc774\ud130\uc758 \uc5c5\ub370\uc774\ud2b8 \uae30\ub2a5\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI\ub780? FastAPI\ub294 \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc744 \uc9c0\uc6d0\ud558\uba70, \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \uc704\ud574 Pydantic\uc744 \ud1b5\ud569\ud558\uc5ec \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \uc774 \ud504\ub808\uc784\uc6cc\ud06c\ub294 \uc131\ub2a5\uacfc \uac1c\ubc1c\uc18d\ub3c4\ub97c \uc911\uc2dc\ud558\uc5ec \uc124\uacc4\ub418\uc5c8\uc73c\uba70, Swagger UI\uc640 ReDoc\uc744 \uae30\ubcf8\uc801\uc73c\ub85c \uc81c\uacf5\ud558\uc5ec API \ubb38\uc11c\ub97c \uc790\ub3d9\uc73c\ub85c \uc0dd\uc131\ud560 \uc218 &hellip; \ub354 \ubcf4\uae30 \"FastAPI \uc11c\ubc84\uac1c\ubc1c, DB \uc870\uc791, U Update\"","og_url":"https:\/\/atmokpo.com\/w\/38512\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T18:17:44+00:00","article_modified_time":"2024-11-26T06:44:07+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":"1\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/38512\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38512\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"FastAPI \uc11c\ubc84\uac1c\ubc1c, DB \uc870\uc791, U Update","datePublished":"2024-11-01T18:17:44+00:00","dateModified":"2024-11-26T06:44:07+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38512\/"},"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\/38512\/","url":"https:\/\/atmokpo.com\/w\/38512\/","name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, DB \uc870\uc791, U Update - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T18:17:44+00:00","dateModified":"2024-11-26T06:44:07+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38512\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38512\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38512\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, DB \uc870\uc791, U Update"}]},{"@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\/38512","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=38512"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38512\/revisions"}],"predecessor-version":[{"id":38513,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38512\/revisions\/38513"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}