{"id":38469,"date":"2024-11-01T18:17:20","date_gmt":"2024-11-01T18:17:20","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38469"},"modified":"2024-11-26T06:44:15","modified_gmt":"2024-11-26T06:44:15","slug":"fastapi-%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c-%ec%8b%a4%ec%8b%9c%ea%b0%84-%ec%b1%84%ed%8c%85-%ec%95%a0%ed%94%8c%eb%a6%ac%ec%bc%80%ec%9d%b4%ec%85%98-%ea%b0%9c%eb%b0%9c%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38469\/","title":{"rendered":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30"},"content":{"rendered":"<p><body><\/p>\n<p>\ucd5c\uadfc \uba87 \ub144\uac04 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0\uc11c \uc2e4\uc2dc\uac04 \ud1b5\uc2e0\uc758 \ud544\uc694\uc131\uc774 \uc99d\uac00\ud558\uba74\uc11c WebSocket\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uac1c\ubc1c\uc774 \uc8fc\ubaa9\ubc1b\uace0 \uc788\uc2b5\ub2c8\ub2e4. FastAPI\ub294 Python\uc73c\ub85c \ub9cc\ub4e4\uc5b4\uc9c4 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uace0\uc131\ub2a5 \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc744 \uc9c0\uc6d0\ud558\uc5ec \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \uc801\ud569\ud569\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \ud65c\uc6a9\ud558\uc5ec \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc744 \ub2e8\uacc4\ubcc4\ub85c \uc124\uba85\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>1. FastAPI\ub780?<\/h2>\n<p>FastAPI\ub294 Python 3.6 \uc774\uc0c1\uc5d0\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, RESTful API\ub97c \uc2e0\uc18d\ud558\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc90d\ub2c8\ub2e4. FastAPI\ub294 \ub2e4\uc74c\uacfc \uac19\uc740 \uc8fc\uc694 \ud2b9\uc9d5\uc774 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<ul>\n<li><strong>\uace0\uc18d\uc131:<\/strong> Starlette\ub97c \uae30\ubc18\uc73c\ub85c \ud558\uace0 \uc788\uc5b4 \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc774 \uac00\ub2a5\ud569\ub2c8\ub2e4.<\/li>\n<li><strong>\uc790\ub3d9\ud654\ub41c API \ubb38\uc11c\ud654:<\/strong> OpenAPI \uc2a4\ud399\uc744 \uae30\ubc18\uc73c\ub85c \uc790\ub3d9\ud654\ub41c Swagger UI\uc640 ReDoc \ubb38\uc11c\uac00 \uc0dd\uc131\ub429\ub2c8\ub2e4.<\/li>\n<li><strong>\ud0c0\uc785 \ud78c\ud2b8 \uc9c0\uc6d0:<\/strong> Python\uc758 \ud0c0\uc785 \ud78c\ud2b8\ub97c \ud65c\uc6a9\ud558\uc5ec \uc624\ub958\ub97c \uc0ac\uc804\uc5d0 \ubc29\uc9c0\ud558\uace0, \uac00\ub3c5\uc131\uc744 \ub192\uc785\ub2c8\ub2e4.<\/li>\n<\/ul>\n<h2>2. \uac1c\ubc1c \ud658\uacbd \uc124\uc815<\/h2>\n<p>\uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud558\uae30 \uc704\ud574\uc11c \uba3c\uc800 \uac1c\ubc1c \ud658\uacbd\uc744 \uc124\uc815\ud569\ub2c8\ub2e4. Python 3.x\uac00 \uc124\uce58\ub418\uc5b4 \uc788\ub2e4\uace0 \uac00\uc815\ud558\uace0, \ud544\uc694\ud55c \ud328\ud0a4\uc9c0\ub97c \uc124\uce58\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>pip install fastapi uvicorn websockets<\/code><\/pre>\n<h2>3. FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uad6c\uc870<\/h2>\n<p>\ud504\ub85c\uc81d\ud2b8 \ub514\ub809\ud1a0\ub9ac\ub97c \uc0dd\uc131\ud558\uace0 \uae30\ubcf8 \uad6c\uc870\ub97c \uc124\uc815\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>mkdir fastapi_chat\ncd fastapi_chat\ntouch main.py<\/code><\/pre>\n<h3>main.py \ud30c\uc77c \uc791\uc131<\/h3>\n<p>\uc774\uc81c <code>main.py<\/code> \ud30c\uc77c\uc5d0 FastAPI \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uacfc WebSocket \ud578\ub4e4\ub7ec\ub97c \uc791\uc131\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>from fastapi import FastAPI, WebSocket, WebSocketDisconnect\nfrom fastapi.responses import HTMLResponse\n\napp = FastAPI()\n\n# HTML \ud398\uc774\uc9c0\ub97c \ubc18\ud658\ud558\ub294 API\n@app.get(\"\/\")\nasync def get():\n    return HTMLResponse(content=\"\"\"\n    <html>\n        <head>\n            <title>Chat Application<\/title>\n        <\/head>\n        <body>\n            <h1>Chat Application<\/h1>\n            <div id=\"chat\"><\/div>\n            <input id=\"message\" type=\"text\"\/>\n            <button onclick=\"sendMessage()\">Send<\/button>\n            <script>\n                const socket = new WebSocket(\"ws:\/\/localhost:8000\/ws\");\n                socket.onmessage = function(event) {\n                    const message = document.createElement(\"div\");\n                    message.innerText = event.data;\n                    document.getElementById(\"chat\").appendChild(message);\n                };\n                function sendMessage() {\n                    const input = document.getElementById(\"message\");\n                    socket.send(input.value);\n                    input.value = '';\n                }\n            <\/script>\n        <\/body>\n    <\/html>\n    \"\"\")\n\n# WebSocket \ud578\ub4e4\ub7ec\nconnections = []\n\n@app.websocket(\"\/ws\")\nasync def websocket_endpoint(websocket: WebSocket):\n    await websocket.accept()\n    connections.append(websocket)\n    try:\n        while True:\n            data = await websocket.receive_text()\n            # \uc5f0\uacb0\ub41c \ubaa8\ub4e0 \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uac8c \uba54\uc2dc\uc9c0\ub97c broadcast\n            for connection in connections:\n                await connection.send_text(data)\n    except WebSocketDisconnect:\n        connections.remove(websocket)<\/code><\/pre>\n<h2>4. \ucf54\ub4dc \uc124\uba85<\/h2>\n<p>\uc704 \ucf54\ub4dc\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uae30\ubcf8\uc801\uc778 \uc6f9\uc18c\ucf13 \uc11c\ubc84\uc640 HTML \ud074\ub77c\uc774\uc5b8\ud2b8\ub97c \uad6c\ud604\ud55c \uac83\uc785\ub2c8\ub2e4. \uac04\ub2e8\ud788 \uc124\uba85\ud574\ubcf4\uaca0\uc2b5\ub2c8\ub2e4:<\/p>\n<ul>\n<li><strong>FastAPI \uc778\uc2a4\ud134\uc2a4:<\/strong> \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1d\uccb4\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/li>\n<li><strong>HTML \ubc18\ud658:<\/strong> <code>get<\/code> \ud568\uc218\ub294 \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uac8c HTML \ud398\uc774\uc9c0\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4.<\/li>\n<li><strong>WebSocket \ud578\ub4e4\ub7ec:<\/strong> <code>\/ws<\/code> \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub294 \ud074\ub77c\uc774\uc5b8\ud2b8\uc640\uc758 \uc2e4\uc2dc\uac04 \uc5f0\uacb0\uc744 \uad00\ub9ac\ud569\ub2c8\ub2e4.<\/li>\n<li><strong>\uba54\uc2dc\uc9c0 \ube0c\ub85c\ub4dc\uce90\uc2a4\ud2b8:<\/strong> \ud074\ub77c\uc774\uc5b8\ud2b8\uac00 \uc11c\ubc84\uc5d0 \uba54\uc2dc\uc9c0\ub97c \ubcf4\ub0bc \ub54c, \uc5f0\uacb0\ub41c \ubaa8\ub4e0 \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uac8c \uba54\uc2dc\uc9c0\ub97c \uc804\uc1a1\ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n<h2>5. \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uc2e4\ud589<\/h2>\n<p>\uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc2e4\ud589\ud558\uae30 \uc704\ud574 \ud130\ubbf8\ub110\uc5d0\uc11c \ub2e4\uc74c \uba85\ub839\uc5b4\ub97c \uc785\ub825\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>uvicorn main:app --reload<\/code><\/pre>\n<p>\uc774\uc81c \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c <code>http:\/\/localhost:8000<\/code>\uc5d0 \uc811\uc18d\ud558\uba74 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc774 \uc5f4\ub9bd\ub2c8\ub2e4. \uc5ec\ub7ec \uac1c\uc758 \ube0c\ub77c\uc6b0\uc800 \ud0ed\uc744 \uc5f4\uace0 \uba54\uc2dc\uc9c0\ub97c \ubcf4\ub0b4\ubcf4\uc138\uc694. \ubaa8\ub4e0 \ud0ed\uc5d0\uc11c \uba54\uc2dc\uc9c0\uac00 \uc2e4\uc2dc\uac04\uc73c\ub85c \ud45c\uc2dc\ub418\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>6. \ucd94\uac00 \uae30\ub2a5 \uad6c\ud604<\/h2>\n<p>\uae30\ubcf8\uc801\uc778 \ucc44\ud305 \uae30\ub2a5 \uc678\uc5d0\ub3c4 \uc5ec\ub7ec \uac00\uc9c0 \uae30\ub2a5\uc744 \ucd94\uac00\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4 \uc0ac\uc6a9\uc790 \uc774\ub984, \uba54\uc2dc\uc9c0 \uc774\ub825 \uc800\uc7a5, \uadf8\ub9ac\uace0 \uc0ac\uc6a9\uc790\ubcc4\ub85c \uba54\uc2dc\uc9c0 \ud544\ud130\ub9c1 \ub4f1\uc744 \uad6c\ud604\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>6.1 \uc0ac\uc6a9\uc790 \uc774\ub984 \uae30\ub2a5 \ucd94\uac00<\/h3>\n<p>\uc0ac\uc6a9\uc790\uac00 \ucc44\ud305\uc5d0 \ucc38\uc5ec\ud560 \ub54c \uc0ac\uc6a9\uc790 \uc774\ub984\uc744 \uc785\ub825\ud558\uac8c \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. HTML \ucf54\ub4dc\uc5d0 \uc0ac\uc6a9\uc790 \uc774\ub984 \uc785\ub825\ub780\uc744 \ucd94\uac00\ud558\uace0, \uba54\uc2dc\uc9c0\ub97c \uc804\uc1a1\ud560 \ub54c \uc774 \uc0ac\uc6a9\uc790 \uc774\ub984\uc744 \ud3ec\ud568\uc2dc\ucf1c \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>HTMLResponse(content=\"\"\"\n<html>\n    <head>\n        <title>Chat Application<\/title>\n    <\/head>\n    <body>\n        <h1>Chat Application<\/h1>\n        <input id=\"username\" placeholder=\"Enter your name\" type=\"text\"\/>\n        <div id=\"chat\"><\/div>\n        <input id=\"message\" placeholder=\"Write a message...\" type=\"text\"\/>\n        <button onclick=\"sendMessage()\">Send<\/button>\n        <script>\n            const socket = new WebSocket(\"ws:\/\/localhost:8000\/ws\");\n            socket.onmessage = function(event) {\n                const message = document.createElement(\"div\");\n                message.innerText = event.data;\n                document.getElementById(\"chat\").appendChild(message);\n            };\n            function sendMessage() {\n                const input = document.getElementById(\"message\");\n                const username = document.getElementById(\"username\").value;\n                socket.send(username + \": \" + input.value);\n                input.value = '';\n            }\n        <\/script>\n    <\/body>\n<\/html>\n\"\"\")<\/code><\/pre>\n<h3>6.2 \uba54\uc2dc\uc9c0 \uc774\ub825 \uc800\uc7a5<\/h3>\n<p>\uc11c\ubc84\uc5d0\uc11c \uc804\uc1a1\ub41c \uba54\uc2dc\uc9c0\ub97c \uc800\uc7a5\ud558\uc5ec \uc0ac\uc6a9\uc790\uac00 \ud398\uc774\uc9c0\ub97c \uc0c8\ub85c\uace0\uce68 \ud574\ub3c4 \uc774\uc804 \uba54\uc2dc\uc9c0\ub97c \ubcfc \uc218 \uc788\ub3c4\ub85d \ub9cc\ub4e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub97c \uc704\ud574 \uba54\ubaa8\ub9ac \ub0b4 \uc800\uc7a5\uc18c\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294\ub370, \ub354 \ub098\uc544\uac00 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\uacb0\ub3c4 \uace0\ub824\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uac04\ub2e8\ud558\uac8c \uba54\uc2dc\uc9c0 \ub9ac\uc2a4\ud2b8\ub97c \ucd94\uac00\ud558\uace0, \ud074\ub77c\uc774\uc5b8\ud2b8\uac00 \uc5f0\uacb0\ud560 \ub54c \uc774 \uba54\uc2dc\uc9c0\ub97c \uc804\uc1a1\ud558\ub294 \ubc29\ubc95\uc744 \uad6c\ud604\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>messages = []\n\nasync def broadcast_message(message: str):\n    messages.append(message)\n    for connection in connections:\n        await connection.send_text(message)\n\n@app.websocket(\"\/ws\")\nasync def websocket_endpoint(websocket: WebSocket):\n    await websocket.accept()\n    connections.append(websocket)\n    try:\n        # \uae30\uc874 \uba54\uc2dc\uc9c0\ub97c \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0 \uc804\uc1a1\n        for message in messages:\n            await websocket.send_text(message)\n        while True:\n            data = await websocket.receive_text()\n            await broadcast_message(data)\n    except WebSocketDisconnect:\n        connections.remove(websocket)<\/code><\/pre>\n<h2>7. \ub9c8\ubb34\ub9ac<\/h2>\n<p>\uc774\ubc88 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uc558\uc2b5\ub2c8\ub2e4. FastAPI\uc758 \ube44\ub3d9\uae30 \uae30\ub2a5\uc744 \ud65c\uc6a9\ud558\uc5ec \uace0\uc131\ub2a5\uc758 \uc2e4\uc2dc\uac04 \uc6f9 \uc18c\ucf13 \uc11c\ubc84\ub97c \uad6c\ucd95\ud558\uace0 \ud074\ub77c\uc774\uc5b8\ud2b8\uc640\uc758 \uc548\uc815\uc801\uc778 \uc5f0\uacb0\uc744 \uc720\uc9c0\ud558\ub294 \ubc95\uc744 \ubc30\uc6e0\uc2b5\ub2c8\ub2e4.<\/p>\n<p>FastAPI\ub294 \uac15\ub825\ud558\uba74\uc11c\ub3c4 \uac04\ub2e8\ud55c API \uac1c\ubc1c \ub3c4\uad6c\ub85c, \ub2e4\uc591\ud55c \uae30\ub2a5\ub4e4\uc744 \ud655\uc7a5\ud558\uc5ec \ub354\uc6b1 \ubcf5\uc7a1\ud55c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uad6c\ucd95\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ucd94\uac00\uc801\uc73c\ub85c \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640\uc758 \uc5f0\uacb0, \uc0ac\uc6a9\uc790 \uc778\uc99d \ubc0f \uc778\uac00, \uadf8\ub9ac\uace0 \uc11c\ub4dc\ud30c\ud2f0 API\uc640\uc758 \ud1b5\ud569 \ub4f1\uc744 \ud1b5\ud574 \ubc1c\uc804\uc2dc\ud0a4\uae30 \ubc14\ub78d\ub2c8\ub2e4.<\/p>\n<p>FastAPI\ub97c \ud1b5\ud574 \uc5ec\ub7ec\ubd84\uc758 \uc544\uc774\ub514\uc5b4\ub97c \uc2e4\ud604\ud574\ubcf4\uc138\uc694! \ud559\uc2b5\uacfc \uacbd\ud5d8\uc744 \ud1b5\ud574 \ub354\uc6b1 \ub9ce\uc740 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud560 \uc218 \uc788\uc744 \uac83\uc785\ub2c8\ub2e4.<\/p>\n<p>\uac10\uc0ac\ud569\ub2c8\ub2e4.<\/p>\n<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ucd5c\uadfc \uba87 \ub144\uac04 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0\uc11c \uc2e4\uc2dc\uac04 \ud1b5\uc2e0\uc758 \ud544\uc694\uc131\uc774 \uc99d\uac00\ud558\uba74\uc11c WebSocket\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uac1c\ubc1c\uc774 \uc8fc\ubaa9\ubc1b\uace0 \uc788\uc2b5\ub2c8\ub2e4. FastAPI\ub294 Python\uc73c\ub85c \ub9cc\ub4e4\uc5b4\uc9c4 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uace0\uc131\ub2a5 \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc744 \uc9c0\uc6d0\ud558\uc5ec \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \uc801\ud569\ud569\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \ud65c\uc6a9\ud558\uc5ec \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc744 \ub2e8\uacc4\ubcc4\ub85c \uc124\uba85\ud558\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI\ub780? FastAPI\ub294 Python 3.6 \uc774\uc0c1\uc5d0\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, RESTful &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38469\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30&#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-38469","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, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30 - \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\/38469\/\" \/>\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, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"\ucd5c\uadfc \uba87 \ub144\uac04 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0\uc11c \uc2e4\uc2dc\uac04 \ud1b5\uc2e0\uc758 \ud544\uc694\uc131\uc774 \uc99d\uac00\ud558\uba74\uc11c WebSocket\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uac1c\ubc1c\uc774 \uc8fc\ubaa9\ubc1b\uace0 \uc788\uc2b5\ub2c8\ub2e4. FastAPI\ub294 Python\uc73c\ub85c \ub9cc\ub4e4\uc5b4\uc9c4 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uace0\uc131\ub2a5 \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc744 \uc9c0\uc6d0\ud558\uc5ec \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \uc801\ud569\ud569\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \ud65c\uc6a9\ud558\uc5ec \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc744 \ub2e8\uacc4\ubcc4\ub85c \uc124\uba85\ud558\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI\ub780? FastAPI\ub294 Python 3.6 \uc774\uc0c1\uc5d0\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, RESTful &hellip; \ub354 \ubcf4\uae30 &quot;FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38469\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T18:17:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:44:15+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\/38469\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38469\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30\",\"datePublished\":\"2024-11-01T18:17:20+00:00\",\"dateModified\":\"2024-11-26T06:44:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38469\/\"},\"wordCount\":38,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"FastAPI\uc11c\ubc84\uac1c\ubc1c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/38469\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38469\/\",\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T18:17:20+00:00\",\"dateModified\":\"2024-11-26T06:44:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38469\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38469\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38469\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30\"}]},{\"@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, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30 - \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\/38469\/","og_locale":"ko_KR","og_type":"article","og_title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"\ucd5c\uadfc \uba87 \ub144\uac04 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0\uc11c \uc2e4\uc2dc\uac04 \ud1b5\uc2e0\uc758 \ud544\uc694\uc131\uc774 \uc99d\uac00\ud558\uba74\uc11c WebSocket\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uac1c\ubc1c\uc774 \uc8fc\ubaa9\ubc1b\uace0 \uc788\uc2b5\ub2c8\ub2e4. FastAPI\ub294 Python\uc73c\ub85c \ub9cc\ub4e4\uc5b4\uc9c4 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uace0\uc131\ub2a5 \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc744 \uc9c0\uc6d0\ud558\uc5ec \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \uc801\ud569\ud569\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \ud65c\uc6a9\ud558\uc5ec \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc744 \ub2e8\uacc4\ubcc4\ub85c \uc124\uba85\ud558\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI\ub780? FastAPI\ub294 Python 3.6 \uc774\uc0c1\uc5d0\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, RESTful &hellip; \ub354 \ubcf4\uae30 \"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30\"","og_url":"https:\/\/atmokpo.com\/w\/38469\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T18:17:20+00:00","article_modified_time":"2024-11-26T06:44:15+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\/38469\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38469\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30","datePublished":"2024-11-01T18:17:20+00:00","dateModified":"2024-11-26T06:44:15+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38469\/"},"wordCount":38,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["FastAPI\uc11c\ubc84\uac1c\ubc1c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/38469\/","url":"https:\/\/atmokpo.com\/w\/38469\/","name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T18:17:20+00:00","dateModified":"2024-11-26T06:44:15+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38469\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38469\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38469\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30"}]},{"@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\/38469","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=38469"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38469\/revisions"}],"predecessor-version":[{"id":38470,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38469\/revisions\/38470"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}