{"id":38624,"date":"2024-11-01T19:08:20","date_gmt":"2024-11-01T19:08:20","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38624"},"modified":"2024-11-26T06:43:47","modified_gmt":"2024-11-26T06:43:47","slug":"django-%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c-%ec%9b%b9%ec%86%8c%ec%bc%93%ec%9d%84-%ed%86%b5%ed%95%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","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38624\/","title":{"rendered":"DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\uae30"},"content":{"rendered":"<p><body><\/p>\n<p>\ucd5c\uadfc \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0\uc11c \uc2e4\uc2dc\uac04 \uae30\ub2a5\uc744 \uc694\uad6c\ud558\ub294 \uacbd\uc6b0\uac00 \ub9ce\uc2b5\ub2c8\ub2e4. \uadf8 \uc911\uc5d0\uc11c\ub3c4 \uc6f9\uc18c\ucf13(WebSocket)\uc740 \ud074\ub77c\uc774\uc5b8\ud2b8\uc640 \uc11c\ubc84 \uac04\uc758 \uc804\uc774\uc911 \ud1b5\uc2e0\uc744 \uac00\ub2a5\ud558\uac8c \ud558\uc5ec \uc2e4\uc2dc\uac04 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \ub9e4\uc6b0 \uc720\uc6a9\ud569\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 Django\ub97c \ud65c\uc6a9\ud558\uc5ec \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>1. Django\uc640 \uc6f9\uc18c\ucf13 \uc18c\uac1c<\/h2>\n<p>Django\ub294 \ud30c\uc774\uc36c \uae30\ubc18\uc758 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc7a5\uace0\ub97c \uc0ac\uc6a9\ud558\uba74 \uac1c\ubc1c\uc790\uac00 \ube60\ub974\uac8c \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uad6c\ucd95\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 Django\uc758 \uae30\ubcf8 \uae30\ub2a5\ub9cc\uc73c\ub85c\ub294 \uc6f9\uc18c\ucf13 \ud1b5\uc2e0\uc744 \ucc98\ub9ac\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uc774\ub7ec\ud55c \uc774\uc720\ub85c Django Channels\ub77c\ub294 \ud328\ud0a4\uc9c0\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc6f9\uc18c\ucf13\uc744 \ucc98\ub9ac\ud569\ub2c8\ub2e4.<\/p>\n<h3>1.1 \uc6f9\uc18c\ucf13\uc774\ub780?<\/h3>\n<p>\uc6f9\uc18c\ucf13\uc740 \uc6f9 \ube0c\ub77c\uc6b0\uc800\uc640 \uc11c\ubc84 \uac04\uc758 \ud1b5\uc2e0\uc744 \uc774\ub8e8\ub294 \ud504\ub85c\ud1a0\ucf5c\ub85c, HTTP\uc640 \ub2ec\ub9ac \uc591\ubc29\ud5a5 \ud1b5\uc2e0\uc744 \uc9c0\uc6d0\ud569\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \ud074\ub77c\uc774\uc5b8\ud2b8\uc640 \uc11c\ubc84 \uac04\uc758 \ub370\uc774\ud130 \uc804\uc1a1\uc774 \uc989\uac01\uc801\uc73c\ub85c \uc774\ub8e8\uc5b4\uc838, \uc2e4\uc2dc\uac04 \uc5c5\ub370\uc774\ud2b8\uac00 \ud544\uc694\ud55c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0 \uc801\ud569\ud569\ub2c8\ub2e4.<\/p>\n<h2>2. Django \ud504\ub85c\uc81d\ud2b8 \uc124\uc815<\/h2>\n<p>\uc774\uc81c \ubcf8\uaca9\uc801\uc73c\ub85c Django \ud504\ub85c\uc81d\ud2b8\ub97c \uc124\uc815\ud574\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc544\ub798 \ub2e8\uacc4\ub97c \ub530\ub77c \ud558\uc138\uc694.<\/p>\n<h3>2.1 \uc0c8 Django \ud504\ub85c\uc81d\ud2b8 \uc0dd\uc131<\/h3>\n<pre><code>django-admin startproject chat_project<\/code><\/pre>\n<p>\uc704\uc758 \uba85\ub839\uc5b4\ub85c \uc0c8 Django \ud504\ub85c\uc81d\ud2b8\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. \ud504\ub85c\uc81d\ud2b8\uc758 \uc774\ub984\uc740 <code>chat_project<\/code>\uc785\ub2c8\ub2e4.<\/p>\n<h3>2.2 Django Channels \uc124\uce58<\/h3>\n<p>\ub2e4\uc74c\uc73c\ub85c, Django Channels\ub97c \uc124\uce58\ud569\ub2c8\ub2e4. \uc544\ub798 \uba85\ub839\uc5b4\ub97c \uc0ac\uc6a9\ud558\uc138\uc694:<\/p>\n<pre><code>pip install channels<\/code><\/pre>\n<h3>2.3 settings.py \uc218\uc815<\/h3>\n<p>\uc124\uce58\uac00 \uc644\ub8cc\ub418\uba74 <code>settings.py<\/code> \ud30c\uc77c\uc744 \uc5f4\uc5b4 \ub2e4\uc74c\uacfc \uac19\uc774 \uc218\uc815\ud569\ub2c8\ub2e4:<\/p>\n<pre><code>\nINSTALLED_APPS = [\n    ...\n    'channels',\n    'chat',  # \ub098\uc911\uc5d0 \ub9cc\ub4e4 \uc571 \ucd94\uac00\n]\n\nASGI_APPLICATION = 'chat_project.asgi.application'\n<\/code><\/pre>\n<h3>2.4 asgi.py \uc0dd\uc131<\/h3>\n<p><code>chat_project<\/code> \ub514\ub809\ud1a0\ub9ac\uc5d0 <code>asgi.py<\/code> \ud30c\uc77c\uc744 \uc0dd\uc131\ud558\uace0 \uc544\ub798\uc640 \uac19\uc774 \uc791\uc131\ud569\ub2c8\ub2e4:<\/p>\n<pre><code>\nimport os\nfrom django.core.asgi import get_asgi_application\nfrom channels.routing import ProtocolTypeRouter, URLRouter\nfrom channels.auth import AuthMiddlewareStack\nfrom chat.routing import websocket_urlpatterns\n\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'chat_project.settings')\n\napplication = ProtocolTypeRouter({\n    \"http\": get_asgi_application(),\n    \"websocket\": AuthMiddlewareStack(\n        URLRouter(\n            websocket_urlpatterns\n        )\n    ),\n})\n<\/code><\/pre>\n<h2>3. \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\uae30<\/h2>\n<p>\uc774\uc81c \uc2e4\uc81c\ub85c \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4e4\uae30 \uc704\ud574 \uc0c8 Django \uc571\uc744 \uc0dd\uc131\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>3.1 \ucc44\ud305 \uc571 \uc0dd\uc131<\/h3>\n<pre><code>python manage.py startapp chat<\/code><\/pre>\n<h3>3.2 chat\/routing.py \uc0dd\uc131<\/h3>\n<p><code>chat<\/code> \ub514\ub809\ud1a0\ub9ac \ub0b4\uc5d0 <code>routing.py<\/code> \ud30c\uc77c\uc744 \uc0dd\uc131\ud558\uace0 \ub2e4\uc74c \ucf54\ub4dc\ub97c \ucd94\uac00\ud569\ub2c8\ub2e4:<\/p>\n<pre><code>\nfrom django.urls import re_path\nfrom . import consumers\n\nwebsocket_urlpatterns = [\n    re_path(r'ws\/chat\/(?P<room_name>\\w+)\/$', consumers.ChatConsumer.as_asgi()),\n]\n<\/room_name><\/code><\/pre>\n<h3>3.3 ChatConsumer \ud074\ub798\uc2a4 \uc0dd\uc131<\/h3>\n<p><code>chat<\/code> \ub514\ub809\ud1a0\ub9ac\uc5d0 <code>consumers.py<\/code> \ud30c\uc77c\uc744 \uc0dd\uc131\ud558\uace0 \ub2e4\uc74c\uacfc \uac19\uc774 \uc791\uc131\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>\nimport json\nfrom channels.generic.websocket import AsyncWebsocketConsumer\n\nclass ChatConsumer(AsyncWebsocketConsumer):\n    async def connect(self):\n        self.room_name = self.scope['url_route']['kwargs']['room_name']\n        self.room_group_name = 'chat_%s' % self.room_name\n\n        # \uadf8\ub8f9\uc5d0 \uc5f0\uacb0\n        await self.channel_layer.group_add(\n            self.room_group_name,\n            self.channel_name\n        )\n\n        await self.accept()\n\n    async def disconnect(self, close_code):\n        # \uadf8\ub8f9\uc5d0\uc11c \uc5f0\uacb0 \ud574\uc81c\n        await self.channel_layer.group_discard(\n            self.room_group_name,\n            self.channel_name\n        )\n\n    async def receive(self, text_data):\n        text_data_json = json.loads(text_data)\n        message = text_data_json['message']\n\n        # \uadf8\ub8f9\uc5d0 \uba54\uc2dc\uc9c0 \uc804\uc1a1\n        await self.channel_layer.group_send(\n            self.room_group_name,\n            {\n                'type': 'chat_message',\n                'message': message\n            }\n        )\n\n    async def chat_message(self, event):\n        message = event['message']\n\n        # WebSocket\uc5d0 \uba54\uc2dc\uc9c0 \uc804\uc1a1\n        await self.send(text_data=json.dumps({\n            'message': message\n        }))\n<\/code><\/pre>\n<h3>3.4 \ucc44\ud305 \ud15c\ud50c\ub9bf \ub9cc\ub4e4\uae30<\/h3>\n<p>\uc774\uc81c \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uc0ac\uc6a9\uc790 \uc778\ud130\ud398\uc774\uc2a4\ub97c \uc704\ud55c HTML \ud15c\ud50c\ub9bf\uc744 \ub9cc\ub4e4\uaca0\uc2b5\ub2c8\ub2e4. <code>chat\/templates\/chat\/<\/code> \ub514\ub809\ud1a0\ub9ac\ub97c \uc0dd\uc131\ud55c \ub2e4\uc74c <code>room.html<\/code> \ud30c\uc77c\uc744 \ub9cc\ub4e4\uace0 \ub2e4\uc74c \ucf54\ub4dc\ub97c \ucd94\uac00\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>\n<!DOCTYPE html>\n\n<html>\n<head>\n    <title>\ucc44\ud305\ub8f8<\/title>\n    <script>\n        const roomName = \"{{ room_name }}\";\n        const chatSocket = new WebSocket(\n            'ws:\/\/' + window.location.host + '\/ws\/chat\/' + roomName + '\/'\n        );\n\n        chatSocket.onmessage = function(e) {\n            const data = JSON.parse(e.data);\n            document.querySelector('#chat-log').value += (data.message + '\\n');\n        };\n\n        chatSocket.onclose = function(e) {\n            console.error('Chat socket closed unexpectedly');\n        };\n\n        document.querySelector('#chat-message-input').focus();\n        document.querySelector('#chat-message-input').onkeyup = function(e) {\n            if (e.keyCode === 13) {  \/\/ Enter key\n                const messageInputDom = document.querySelector('#chat-message-input');\n                const message = messageInputDom.value;\n                chatSocket.send(JSON.stringify({\n                    'message': message\n                }));\n                messageInputDom.value = '';\n            }\n        };\n    <\/script>\n<\/head>\n<body>\n    <h1>{{ room_name }} \ucc44\ud305\ub8f8<\/h1>\n    <textarea cols=\"100\" id=\"chat-log\" rows=\"20\"><\/textarea><br\/>\n    <input id=\"chat-message-input\" size=\"100\" type=\"text\"\/><br\/>\n<\/body>\n<\/html>\n<\/code><\/pre>\n<h2>4. URL \uc124\uc815<\/h2>\n<p>\uc774\uc81c URL \uc124\uc815\uc744 \uc644\ub8cc\ud558\uaca0\uc2b5\ub2c8\ub2e4. <code>chat\/urls.py<\/code> \ud30c\uc77c\uc744 \uc0dd\uc131\ud558\uace0 \ub2e4\uc74c\uacfc \uac19\uc774 \uc791\uc131\ud569\ub2c8\ub2e4:<\/p>\n<pre><code>\nfrom django.urls import path\nfrom . import views\n\nurlpatterns = [\n    path('<str:room_name>\/', views.room, name='room'),\n]\n<\/str:room_name><\/code><\/pre>\n<h3>4.1 views.py \uc218\uc815<\/h3>\n<p><code>views.py<\/code> \ud30c\uc77c\uc744 \uc218\uc815\ud558\uc5ec \ucc44\ud305\ub8f8 \ubdf0\ub97c \ucd94\uac00\ud569\ub2c8\ub2e4:<\/p>\n<pre><code>\nfrom django.shortcuts import render\n\ndef room(request, room_name):\n    return render(request, 'chat\/room.html', {\n        'room_name': room_name\n    })\n<\/code><\/pre>\n<h3>4.2 \uba54\uc778 URL \uc124\uc815<\/h3>\n<p>\ud504\ub85c\uc81d\ud2b8\uc758 \uba54\uc778 <code>urls.py<\/code> \ud30c\uc77c\uc744 \uc218\uc815\ud558\uc5ec \ucc44\ud305 \uc571\uc758 URL\uc744 \ud3ec\ud568\uc2dc\ud0b5\ub2c8\ub2e4:<\/p>\n<pre><code>\nfrom django.contrib import admin\nfrom django.urls import path, include\n\nurlpatterns = [\n    path('admin\/', admin.site.urls),\n    path('chat\/', include('chat.urls')),\n]\n<\/code><\/pre>\n<h2>5. Redis \uc124\uc815 (\uc635\uc158)<\/h2>\n<p>\uc2e4\uc2dc\uac04 \ud1b5\uc2e0\uc744 \uc704\ud574 Redis\ub97c \uc0ac\uc6a9\ud558\ub294 \uac83\ub3c4 \uace0\ub824\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. Redis\ub294 \uba54\uc2dc\uc9c0 \ube0c\ub85c\ucee4\ub85c \uc0ac\uc6a9\ub418\uba70, \ub2e4\uc74c\uacfc \uac19\uc740 \uc124\uc815\uc774 \ud544\uc694\ud569\ub2c8\ub2e4. \uba3c\uc800 Redis\ub97c \uc124\uce58\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<pre><code>sudo apt-get install redis-server<\/code><\/pre>\n<p>\uadf8 \ud6c4, Redis\uc640 Channels\ub97c \ud1b5\ud569\ud558\uae30 \uc704\ud574 \ub2e4\uc74c \ud328\ud0a4\uc9c0\ub97c \uc124\uce58\ud569\ub2c8\ub2e4:<\/p>\n<pre><code>pip install channels-redis<\/code><\/pre>\n<p>\uadf8\ub9ac\uace0 <code>settings.py<\/code>\uc5d0 \ub2e4\uc74c\uc744 \ucd94\uac00\ud569\ub2c8\ub2e4:<\/p>\n<pre><code>\nCHANNEL_LAYERS = {\n    'default': {\n        'BACKEND': 'channels_redis.core.RedisChannelLayer',\n        'CONFIG': {\n            \"hosts\": [(\"127.0.0.1\", 6379)],\n        },\n    },\n}\n<\/code><\/pre>\n<h2>6. \uc11c\ubc84 \uc2e4\ud589 \ubc0f \ud14c\uc2a4\ud2b8<\/h2>\n<p>\ubaa8\ub4e0 \uc124\uc815\uc774 \uc644\ub8cc\ub418\uba74 Django \uc11c\ubc84\ub97c \uc2e4\ud589\ud569\ub2c8\ub2e4. \uc544\ub798 \uba85\ub839\uc5b4\ub97c \uc0ac\uc6a9\ud558\uc138\uc694:<\/p>\n<pre><code>python manage.py runserver<\/code><\/pre>\n<p>\uadf8 \ud6c4, \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c <code>http:\/\/127.0.0.1:8000\/chat\/{room_name}\/<\/code>\uc5d0 \uc811\uc18d\ud558\uc5ec \uc6d0\ud558\uc2dc\ub294 \ubc29 \uc774\ub984\uc744 \uc785\ub825\ud558\uace0 \ucc44\ud305\uc744 \uc2dc\uc791\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>\uacb0\ub860<\/h2>\n<p>\uc774\ubc88 \ud29c\ud1a0\ub9ac\uc5bc\uc5d0\uc11c\ub294 Django\ub97c \uc0ac\uc6a9\ud574 \uc6f9\uc18c\ucf13 \uae30\ubc18\uc758 \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc744 \ubc30\uc6e0\uc2b5\ub2c8\ub2e4. Django Channels\ub97c \ud65c\uc6a9\ud558\uc5ec \uc6f9\uc18c\ucf13\uc744 \uc124\uc815\ud558\uace0, \ud074\ub77c\uc774\uc5b8\ud2b8\uc640 \uc11c\ubc84 \uac04\uc758 \uc2e4\uc2dc\uac04 \ud1b5\uc2e0\uc744 \uad6c\ud604\ud558\ub294 \uacfc\uc815\uc744 \uc0c1\uc138\ud788 \uc124\uba85\ud588\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ub354 \ub098\uc544\uac00 \uc5ec\ub7ec\ubd84\uc740 \ubc29 \uad00\ub9ac, \uc0ac\uc6a9\uc790 \uc778\uc99d, \ucc44\ud305 \uae30\ub85d \uc800\uc7a5 \uac19\uc740 \uae30\ub2a5\uc744 \ucd94\uac00\ud558\uba70 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ud655\uc7a5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774 \uacfc\uc815\uc5d0\uc11c Django\uc758 \uac15\ub825\ud55c \uae30\ub2a5\uacfc \uc6f9\uc18c\ucf13 \ud1b5\uc2e0\uc758 \uc774\uc810\uc744 \uadf9\ub300\ud654\ud558\uc138\uc694.<\/p>\n<p>\uc774 \ud29c\ud1a0\ub9ac\uc5bc\uc5d0 \uce5c\uc560\ud558\ub294 \ubd84\ub4e4\uc758 \uc131\uacf5\uc801\uc778 \uc6f9 \uac1c\ubc1c\uc744 \uae30\uc6d0\ud569\ub2c8\ub2e4!<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ucd5c\uadfc \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0\uc11c \uc2e4\uc2dc\uac04 \uae30\ub2a5\uc744 \uc694\uad6c\ud558\ub294 \uacbd\uc6b0\uac00 \ub9ce\uc2b5\ub2c8\ub2e4. \uadf8 \uc911\uc5d0\uc11c\ub3c4 \uc6f9\uc18c\ucf13(WebSocket)\uc740 \ud074\ub77c\uc774\uc5b8\ud2b8\uc640 \uc11c\ubc84 \uac04\uc758 \uc804\uc774\uc911 \ud1b5\uc2e0\uc744 \uac00\ub2a5\ud558\uac8c \ud558\uc5ec \uc2e4\uc2dc\uac04 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \ub9e4\uc6b0 \uc720\uc6a9\ud569\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 Django\ub97c \ud65c\uc6a9\ud558\uc5ec \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4. 1. Django\uc640 \uc6f9\uc18c\ucf13 \uc18c\uac1c Django\ub294 \ud30c\uc774\uc36c \uae30\ubc18\uc758 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc7a5\uace0\ub97c \uc0ac\uc6a9\ud558\uba74 \uac1c\ubc1c\uc790\uac00 \ube60\ub974\uac8c \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uad6c\ucd95\ud560 \uc218 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38624\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\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":[185],"tags":[],"class_list":["post-38624","post","type-post","status-publish","format-standard","hentry","category-django"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\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\/38624\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"\ucd5c\uadfc \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0\uc11c \uc2e4\uc2dc\uac04 \uae30\ub2a5\uc744 \uc694\uad6c\ud558\ub294 \uacbd\uc6b0\uac00 \ub9ce\uc2b5\ub2c8\ub2e4. \uadf8 \uc911\uc5d0\uc11c\ub3c4 \uc6f9\uc18c\ucf13(WebSocket)\uc740 \ud074\ub77c\uc774\uc5b8\ud2b8\uc640 \uc11c\ubc84 \uac04\uc758 \uc804\uc774\uc911 \ud1b5\uc2e0\uc744 \uac00\ub2a5\ud558\uac8c \ud558\uc5ec \uc2e4\uc2dc\uac04 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \ub9e4\uc6b0 \uc720\uc6a9\ud569\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 Django\ub97c \ud65c\uc6a9\ud558\uc5ec \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4. 1. Django\uc640 \uc6f9\uc18c\ucf13 \uc18c\uac1c Django\ub294 \ud30c\uc774\uc36c \uae30\ubc18\uc758 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc7a5\uace0\ub97c \uc0ac\uc6a9\ud558\uba74 \uac1c\ubc1c\uc790\uac00 \ube60\ub974\uac8c \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uad6c\ucd95\ud560 \uc218 &hellip; \ub354 \ubcf4\uae30 &quot;DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\uae30&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38624\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T19:08:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:43:47+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\/38624\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38624\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\uae30\",\"datePublished\":\"2024-11-01T19:08:20+00:00\",\"dateModified\":\"2024-11-26T06:43:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38624\/\"},\"wordCount\":44,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"DJango\uc11c\ubc84\uac1c\ubc1c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/38624\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38624\/\",\"name\":\"DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T19:08:20+00:00\",\"dateModified\":\"2024-11-26T06:43:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38624\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38624\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38624\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\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":"DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\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\/38624\/","og_locale":"ko_KR","og_type":"article","og_title":"DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"\ucd5c\uadfc \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0\uc11c \uc2e4\uc2dc\uac04 \uae30\ub2a5\uc744 \uc694\uad6c\ud558\ub294 \uacbd\uc6b0\uac00 \ub9ce\uc2b5\ub2c8\ub2e4. \uadf8 \uc911\uc5d0\uc11c\ub3c4 \uc6f9\uc18c\ucf13(WebSocket)\uc740 \ud074\ub77c\uc774\uc5b8\ud2b8\uc640 \uc11c\ubc84 \uac04\uc758 \uc804\uc774\uc911 \ud1b5\uc2e0\uc744 \uac00\ub2a5\ud558\uac8c \ud558\uc5ec \uc2e4\uc2dc\uac04 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \ub9e4\uc6b0 \uc720\uc6a9\ud569\ub2c8\ub2e4. \ubcf8 \uae00\uc5d0\uc11c\ub294 Django\ub97c \ud65c\uc6a9\ud558\uc5ec \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4. 1. Django\uc640 \uc6f9\uc18c\ucf13 \uc18c\uac1c Django\ub294 \ud30c\uc774\uc36c \uae30\ubc18\uc758 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc7a5\uace0\ub97c \uc0ac\uc6a9\ud558\uba74 \uac1c\ubc1c\uc790\uac00 \ube60\ub974\uac8c \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uad6c\ucd95\ud560 \uc218 &hellip; \ub354 \ubcf4\uae30 \"DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\uae30\"","og_url":"https:\/\/atmokpo.com\/w\/38624\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T19:08:20+00:00","article_modified_time":"2024-11-26T06:43:47+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\/38624\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38624\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\uae30","datePublished":"2024-11-01T19:08:20+00:00","dateModified":"2024-11-26T06:43:47+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38624\/"},"wordCount":44,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["DJango\uc11c\ubc84\uac1c\ubc1c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/38624\/","url":"https:\/\/atmokpo.com\/w\/38624\/","name":"DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T19:08:20+00:00","dateModified":"2024-11-26T06:43:47+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38624\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38624\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38624\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"DJango \uc11c\ubc84\uac1c\ubc1c, \uc6f9\uc18c\ucf13\uc744 \ud1b5\ud55c \uc2e4\uc2dc\uac04 \ucc44\ud305 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\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\/38624","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=38624"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38624\/revisions"}],"predecessor-version":[{"id":38625,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38624\/revisions\/38625"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}