{"id":38504,"date":"2024-11-01T18:17:39","date_gmt":"2024-11-01T18:17:39","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38504"},"modified":"2024-11-26T06:44:08","modified_gmt":"2024-11-26T06:44:08","slug":"fastapi-%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c-%ec%9d%98%ec%a1%b4%ec%84%b1-%ec%a3%bc%ec%9e%85%ec%9d%98-%ea%b0%9c%eb%85%90-%eb%b0%8f-fastapi%ec%97%90%ec%84%9c%ec%9d%98-%ea%b5%ac%ed%98%84","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38504\/","title":{"rendered":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604"},"content":{"rendered":"<p><body><\/p>\n<p>FastAPI\ub294 \ud604\ub300\uc801\uc778 Python \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d \uae30\ub2a5\uacfc \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \ub9e4\uc6b0 \ud6a8\uc728\uc801\uc73c\ub85c \ucc98\ub9ac\ud560 \uc218 \uc788\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\uc5d0\uc11c\uc758 \uc758\uc874\uc131 \uc8fc\uc785(Dependency Injection, DI)\uc758 \uac1c\ub150\uacfc \uc774\ub97c \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc2ec\ub3c4 \uc788\uac8c \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>1. \uc758\uc874\uc131 \uc8fc\uc785(Dependency Injection) \uac1c\ub150<\/h2>\n<p>\uc758\uc874\uc131 \uc8fc\uc785\uc740 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \uac1c\ubc1c\uc5d0\uc11c \uac1d\uccb4\uc758 \uc758\uc874\uc131\uc744 \uad00\ub9ac\ud558\ub294 \ud328\ud134\uc785\ub2c8\ub2e4. \uc774\ub294 \uac1d\uccb4\uac00 \ud544\uc694\ud55c \uc758\uc874\uc131\uc744 \uc2a4\uc2a4\ub85c \uc0dd\uc131\ud558\ub294 \uac83\uc774 \uc544\ub2c8\ub77c, \uc678\ubd80\uc5d0\uc11c \uc8fc\uc785\ubc1b\ub294 \ubc29\uc2dd\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c \uc811\uadfc \ubc29\uc2dd\uc740 \ucf54\ub4dc\uc758 \uc7ac\uc0ac\uc6a9\uc131\uc744 \ub192\uc774\uace0, \ud14c\uc2a4\ud2b8 \uc6a9\uc774\uc131\uc744 \ud5a5\uc0c1\uc2dc\ud0a4\uba70, \uc720\uc9c0\ubcf4\uc218\uc131\uc744 \uac15\ud654\ud569\ub2c8\ub2e4.<\/p>\n<h3>1.1 \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uc7a5\uc810<\/h3>\n<ul>\n<li><strong>\uc720\uc9c0\ubcf4\uc218\uc131:<\/strong> \uc758\uc874\uc131\uc744 \uc678\ubd80\ub85c \ubd84\ub9ac\ud568\uc73c\ub85c\uc368 \ucf54\ub4dc\uc758 \uc720\ub3d9\uc131\uc744 \uc99d\uac00\uc2dc\ud0a4\uace0, \ubcc0\uacbd\uc758 \uc601\ud5a5\uc744 \ucd5c\uc18c\ud654\ud569\ub2c8\ub2e4.<\/li>\n<li><strong>\ud14c\uc2a4\ud2b8 \uc6a9\uc774\uc131:<\/strong> \uc758\uc874\uc131\uc744 \uc8fc\uc785\ubc1b\uae30 \ub54c\ubb38\uc5d0, \ubaa8\uc758 \uac1d\uccb4(mock object)\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub2e8\uc704 \ud14c\uc2a4\ud2b8\ub97c \uc27d\uac8c \uc791\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<li><strong>\uc7ac\uc0ac\uc6a9\uc131:<\/strong> \uac01 \uad6c\uc131 \uc694\uc18c\uac00 \ub3c5\ub9bd\uc801\uc73c\ub85c \uc124\uacc4\ub418\ubbc0\ub85c, \ucf54\ub4dc\uc758 \uc7ac\uc0ac\uc6a9\uc131\uc774 \ub192\uc544\uc9d1\ub2c8\ub2e4.<\/li>\n<\/ul>\n<h2>2. FastAPI\uc5d0\uc11c\uc758 \uc758\uc874\uc131 \uc8fc\uc785 \uad6c\ud604<\/h2>\n<p>FastAPI\ub294 \uc758\uc874\uc131 \uc8fc\uc785\uc744 \uc9c0\uc6d0\ud558\ub294 \uac15\ub825\ud55c \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\uc5d0\uc11c \uc758\uc874\uc131\uc744 \uc815\uc758\ud558\ub824\uba74 \ub2e4\uc74c\uc758 \uc138 \uac00\uc9c0 \ub2e8\uacc4\ub85c \ub098\ub20c \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<ol>\n<li>\uc758\uc874\uc131 \ud568\uc218 \uc815\uc758\ud558\uae30<\/li>\n<li>\uc758\uc874\uc131\uc744 \ub77c\uc6b0\ud2b8\uc5d0 \uc8fc\uc785\ud558\uae30<\/li>\n<li>\uc758\uc874\uc131\uc744 \uc0ac\uc6a9\ud558\ub294 \uc11c\ube44\uc2a4 \uad6c\ud604\ud558\uae30<\/li>\n<\/ol>\n<h3>2.1 \uc758\uc874\uc131 \ud568\uc218 \uc815\uc758\ud558\uae30<\/h3>\n<p>\uc758\uc874\uc131 \ud568\uc218\ub294 \ub2e4\ub978 \ub77c\uc6b0\ud2b8\uc5d0\uc11c \uc7ac\uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uacf5\ud1b5\uc801\uc778 \uae30\ub2a5\uc744 \uc815\uc758\ud569\ub2c8\ub2e4. \uc544\ub798\uc758 \uc608\uc81c\uc5d0\uc11c\ub294 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\uacb0\uc744 \uc758\uc874\uc131\uc73c\ub85c \uc124\uc815\ud558\ub294 \ubc29\ubc95\uc744 \ubcf4\uc5ec\uc90d\ub2c8\ub2e4:<\/p>\n<pre class=\"example-code\">\nfrom fastapi import Depends, FastAPI\n\napp = FastAPI()\n\n# \uc758\uc874\uc131 \ud568\uc218 \uc815\uc758\ndef get_db():\n    db = \"\ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\uacb0\"\n    try:\n        yield db\n    finally:\n        print(\"\ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\uacb0 \uc885\ub8cc\")\n<\/pre>\n<h3>2.2 \uc758\uc874\uc131\uc744 \ub77c\uc6b0\ud2b8\uc5d0 \uc8fc\uc785\ud558\uae30<\/h3>\n<p>\uc758\uc874\uc131 \ud568\uc218\ub97c \uc815\uc758\ud55c \ud6c4, \uc774\ub97c \ub77c\uc6b0\ud2b8\uc5d0\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc544\ub798\uc758 \uc0d8\ud50c \ucf54\ub4dc\uc5d0\uc11c\ub294 \uc55e\uc11c \uc815\uc758\ud55c <code>get_db<\/code> \ud568\uc218\ub97c \ub77c\uc6b0\ud2b8\uc5d0 \uc8fc\uc785\ud569\ub2c8\ub2e4:<\/p>\n<pre class=\"example-code\">\n@app.get(\"\/items\/\")\nasync def read_items(db: str = Depends(get_db)):\n    return {\"message\": \"\ud56d\ubaa9 \uc815\ubcf4\ub97c \uac00\uc838\uc654\uc2b5\ub2c8\ub2e4.\", \"db_connection\": db}\n<\/pre>\n<h3>2.3 \uc758\uc874\uc131\uc744 \uc0ac\uc6a9\ud558\ub294 \uc11c\ube44\uc2a4 \uad6c\ud604\ud558\uae30<\/h3>\n<p>\uc758\uc874\uc131 \uc8fc\uc785\uc744 \ud1b5\ud574 \uc11c\ube44\uc2a4 \uacc4\uce35\uc744 \uad6c\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. FastAPI\uc5d0\uc11c\ub294 \uc774\ub7ec\ud55c \uc11c\ube44\uc2a4\ub97c \uc27d\uac8c \uad6c\ud604\ud560 \uc218 \uc788\uac8c \ub3c4\uc640\uc90d\ub2c8\ub2e4. \ub2e4\uc74c \uc608\uc81c\uc5d0\uc11c\ub294 \uc758\uc874\uc131 \uc8fc\uc785\uc744 \ud1b5\ud574 \uc0ac\uc6a9\uc790 \uc815\ubcf4\ub97c \ucc98\ub9ac\ud558\ub294 \uc11c\ube44\uc2a4\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4:<\/p>\n<pre class=\"example-code\">\nclass UserService:\n    def __init__(self, db: str):\n        self.db = db\n\n    def get_user(self, user_id: int):\n        # \uc0ac\uc6a9\uc790 \uc815\ubcf4\ub97c \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0\uc11c \uac00\uc838\uc624\ub294 \ub85c\uc9c1\n        return {\"user_id\": user_id, \"db_connection\": self.db}\n\n@app.get(\"\/users\/{user_id}\")\nasync def read_user(user_id: int, db: str = Depends(get_db)):\n    service = UserService(db)\n    return service.get_user(user_id)\n<\/pre>\n<h2>3. FastAPI\uc5d0\uc11c\uc758 \uc758\uc874\uc131 \uc8fc\uc785 \uc0ac\uc6a9 \uc608\uc81c<\/h2>\n<h3>3.1 \uc608\uc81c: \uac04\ub2e8\ud55c \uac8c\uc2dc\ud310 API<\/h3>\n<p>\uc544\ub798\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uac04\ub2e8\ud55c \uac8c\uc2dc\ud310 API\ub97c \uad6c\ud604\ud558\ub294 \uc608\uc81c\uc785\ub2c8\ub2e4. \uc774 \uc608\uc81c\uc5d0\uc11c\ub294 \uc758\uc874\uc131 \uc8fc\uc785\uc744 \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\uacb0\uacfc \uac8c\uc2dc\ubb3c \uc11c\ube44\uc2a4\ub97c \uad00\ub9ac\ud569\ub2c8\ub2e4.<\/p>\n<pre class=\"example-code\">\nfrom fastapi import FastAPI, Depends\nfrom typing import List\n\napp = FastAPI()\n\n# \uac00\uc0c1 \ub370\uc774\ud130\ubca0\uc774\uc2a4\nposts_db = []\n\n# \uc758\uc874\uc131 \ud568\uc218\ndef get_db():\n    return posts_db\n\n# \uac8c\uc2dc\ubb3c \ubaa8\ub378\nclass Post:\n    id: int\n    title: str\n    content: str\n\n# \uac8c\uc2dc\ubb3c \uc11c\ube44\uc2a4\nclass PostService:\n    def __init__(self, db: List[Post]):\n        self.db = db\n\n    def create_post(self, title: str, content: str):\n        post = Post(id=len(self.db) + 1, title=title, content=content)\n        self.db.append(post)\n        return post\n    \n    def get_posts(self):\n        return self.db\n\n# \uac8c\uc2dc\ubb3c \uc0dd\uc131 API\n@app.post(\"\/posts\/\", response_model=Post)\nasync def create_post(title: str, content: str, db: List[Post] = Depends(get_db)):\n    service = PostService(db)\n    return service.create_post(title, content)\n\n# \ubaa8\ub4e0 \uac8c\uc2dc\ubb3c \uc870\ud68c API\n@app.get(\"\/posts\/\", response_model=List[Post])\nasync def read_posts(db: List[Post] = Depends(get_db)):\n    service = PostService(db)\n    return service.get_posts()\n<\/pre>\n<h2>4. \ud14c\uc2a4\ud2b8\uc640 \ud65c\uc6a9<\/h2>\n<p>\uc758\uc874\uc131 \uc8fc\uc785\uc744 \ud65c\uc6a9\ud558\uc5ec \uac01 \uc131\uacf5\uc801\uc778 \ud14c\uc2a4\ud2b8\ub97c \uc791\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, <code>PostService<\/code>\uc758 \uc778\uc2a4\ud134\uc2a4\ub97c \ubaa8\uc758 \uac1d\uccb4\ub85c \uc8fc\uc785\ud558\uc5ec, \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640\uc758 \uc758\uc874\uc131\uc744 \uc904\uc774\uba74\uc11c\ub3c4 \uc11c\ube44\uc2a4 \ub85c\uc9c1\uc744 \ud14c\uc2a4\ud2b8\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>4.1 pytest\ub97c \ud65c\uc6a9\ud55c \ud14c\uc2a4\ud2b8 \uc608\uc81c<\/h3>\n<p>\ub9ac\uc5bc \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ub300\uc2e0 \uac04\ub2e8\ud55c \ubaa9(mock) \ub370\uc774\ud130\ub97c \uc0ac\uc6a9\ud574 \ud14c\uc2a4\ud2b8\ud558\ub294 \ubc29\ubc95\uc744 \ubcf4\uc5ec\ub4dc\ub9bd\ub2c8\ub2e4:<\/p>\n<pre class=\"example-code\">\nfrom fastapi.testclient import TestClient\n\nclient = TestClient(app)\n\ndef test_create_post():\n    response = client.post(\"\/posts\/\", json={\"title\": \"\ud14c\uc2a4\ud2b8 \uc81c\ubaa9\", \"content\": \"\ud14c\uc2a4\ud2b8 \ub0b4\uc6a9\"})\n    assert response.status_code == 200\n    assert response.json()[\"title\"] == \"\ud14c\uc2a4\ud2b8 \uc81c\ubaa9\"\n\ndef test_read_posts():\n    response = client.get(\"\/posts\/\")\n    assert response.status_code == 200\n    assert len(response.json()) &gt; 0\n<\/pre>\n<h2>5. \uacb0\ub860<\/h2>\n<p>FastAPI\uc5d0\uc11c\uc758 \uc758\uc874\uc131 \uc8fc\uc785\uc740 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uad6c\uc870\ub97c \uba85\ud655\ud788 \ud558\uace0, \ucf54\ub4dc\uc758 \uac00\ub3c5\uc131\uc744 \ub192\uc774\uba70, \uc720\uc9c0\ubcf4\uc218 \ubc0f \ud14c\uc2a4\ud2b8\ub97c \uc27d\uac8c \ub9cc\ub4e4\uc5b4 \uc90d\ub2c8\ub2e4. \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150\uc744 \uc774\ud574\ud558\uace0, \uc774\ub97c FastAPI\uc5d0\uc11c \ud6a8\uacfc\uc801\uc73c\ub85c \ud65c\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d \ud558\ub294 \uac83\uc774 \uc911\uc694\ud569\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c \uc81c\uacf5\ud55c \uc608\uc81c\uc640 \uac1c\ub150\ub4e4\uc774 \uc5ec\ub7ec\ubd84\uc758 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \ub9ce\uc740 \ub3c4\uc6c0\uc774 \ub418\uae38 \ubc14\ub78d\ub2c8\ub2e4. FastAPI\ub97c \ud1b5\ud55c \uc11c\ubc84 \uac1c\ubc1c\uc744 \ud1b5\ud558\uc5ec \uc5ec\ub7ec\ubd84\uc758 \ud504\ub85c\uc81d\ud2b8\ub97c \ud55c \ub2e8\uacc4 \ub354 \ubc1c\uc804\uc2dc\ucf1c \ubcf4\uc138\uc694!<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>FastAPI\ub294 \ud604\ub300\uc801\uc778 Python \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d \uae30\ub2a5\uacfc \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \ub9e4\uc6b0 \ud6a8\uc728\uc801\uc73c\ub85c \ucc98\ub9ac\ud560 \uc218 \uc788\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\uc5d0\uc11c\uc758 \uc758\uc874\uc131 \uc8fc\uc785(Dependency Injection, DI)\uc758 \uac1c\ub150\uacfc \uc774\ub97c \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc2ec\ub3c4 \uc788\uac8c \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4. 1. \uc758\uc874\uc131 \uc8fc\uc785(Dependency Injection) \uac1c\ub150 \uc758\uc874\uc131 \uc8fc\uc785\uc740 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \uac1c\ubc1c\uc5d0\uc11c \uac1d\uccb4\uc758 \uc758\uc874\uc131\uc744 \uad00\ub9ac\ud558\ub294 \ud328\ud134\uc785\ub2c8\ub2e4. \uc774\ub294 \uac1d\uccb4\uac00 \ud544\uc694\ud55c \uc758\uc874\uc131\uc744 \uc2a4\uc2a4\ub85c \uc0dd\uc131\ud558\ub294 \uac83\uc774 \uc544\ub2c8\ub77c, \uc678\ubd80\uc5d0\uc11c &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38504\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604&#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-38504","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, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604 - \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\/38504\/\" \/>\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, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"FastAPI\ub294 \ud604\ub300\uc801\uc778 Python \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d \uae30\ub2a5\uacfc \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \ub9e4\uc6b0 \ud6a8\uc728\uc801\uc73c\ub85c \ucc98\ub9ac\ud560 \uc218 \uc788\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\uc5d0\uc11c\uc758 \uc758\uc874\uc131 \uc8fc\uc785(Dependency Injection, DI)\uc758 \uac1c\ub150\uacfc \uc774\ub97c \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc2ec\ub3c4 \uc788\uac8c \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4. 1. \uc758\uc874\uc131 \uc8fc\uc785(Dependency Injection) \uac1c\ub150 \uc758\uc874\uc131 \uc8fc\uc785\uc740 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \uac1c\ubc1c\uc5d0\uc11c \uac1d\uccb4\uc758 \uc758\uc874\uc131\uc744 \uad00\ub9ac\ud558\ub294 \ud328\ud134\uc785\ub2c8\ub2e4. \uc774\ub294 \uac1d\uccb4\uac00 \ud544\uc694\ud55c \uc758\uc874\uc131\uc744 \uc2a4\uc2a4\ub85c \uc0dd\uc131\ud558\ub294 \uac83\uc774 \uc544\ub2c8\ub77c, \uc678\ubd80\uc5d0\uc11c &hellip; \ub354 \ubcf4\uae30 &quot;FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38504\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T18:17:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:44:08+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\/38504\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38504\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604\",\"datePublished\":\"2024-11-01T18:17:39+00:00\",\"dateModified\":\"2024-11-26T06:44:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38504\/\"},\"wordCount\":25,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"FastAPI\uc11c\ubc84\uac1c\ubc1c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/38504\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38504\/\",\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T18:17:39+00:00\",\"dateModified\":\"2024-11-26T06:44:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38504\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38504\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38504\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604\"}]},{\"@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, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604 - \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\/38504\/","og_locale":"ko_KR","og_type":"article","og_title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"FastAPI\ub294 \ud604\ub300\uc801\uc778 Python \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d \uae30\ub2a5\uacfc \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \ub9e4\uc6b0 \ud6a8\uc728\uc801\uc73c\ub85c \ucc98\ub9ac\ud560 \uc218 \uc788\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\uc5d0\uc11c\uc758 \uc758\uc874\uc131 \uc8fc\uc785(Dependency Injection, DI)\uc758 \uac1c\ub150\uacfc \uc774\ub97c \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc2ec\ub3c4 \uc788\uac8c \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4. 1. \uc758\uc874\uc131 \uc8fc\uc785(Dependency Injection) \uac1c\ub150 \uc758\uc874\uc131 \uc8fc\uc785\uc740 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \uac1c\ubc1c\uc5d0\uc11c \uac1d\uccb4\uc758 \uc758\uc874\uc131\uc744 \uad00\ub9ac\ud558\ub294 \ud328\ud134\uc785\ub2c8\ub2e4. \uc774\ub294 \uac1d\uccb4\uac00 \ud544\uc694\ud55c \uc758\uc874\uc131\uc744 \uc2a4\uc2a4\ub85c \uc0dd\uc131\ud558\ub294 \uac83\uc774 \uc544\ub2c8\ub77c, \uc678\ubd80\uc5d0\uc11c &hellip; \ub354 \ubcf4\uae30 \"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604\"","og_url":"https:\/\/atmokpo.com\/w\/38504\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T18:17:39+00:00","article_modified_time":"2024-11-26T06:44:08+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\/38504\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38504\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604","datePublished":"2024-11-01T18:17:39+00:00","dateModified":"2024-11-26T06:44:08+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38504\/"},"wordCount":25,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["FastAPI\uc11c\ubc84\uac1c\ubc1c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/38504\/","url":"https:\/\/atmokpo.com\/w\/38504\/","name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T18:17:39+00:00","dateModified":"2024-11-26T06:44:08+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38504\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38504\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38504\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc758\uc874\uc131 \uc8fc\uc785\uc758 \uac1c\ub150 \ubc0f FastAPI\uc5d0\uc11c\uc758 \uad6c\ud604"}]},{"@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\/38504","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=38504"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38504\/revisions"}],"predecessor-version":[{"id":38505,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38504\/revisions\/38505"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}