{"title":"다프네와 함께 django를 사용하는 방법","version":"6.1","locale":"ko","docname":"howto/deployment/asgi/daphne","url":"/ko/6.1/howto/deployment/asgi/daphne/","canonical":"https://djangodocs.dev/ko/6.1/howto/deployment/asgi/daphne/","summary":":pypi: ` Daphne <daphne>`는 UNIX용 순수 Python ASGI 서버로, Django 프로젝트의 멤버들이 유지 관리합니다. ASGI의 참조 서버 역할을 합니다. 다프네 설치 Link to this heading # `` pip``로 Daphne를 설치할 수 있습니다.…","html":"<h1>다프네와 함께 django를 사용하는 방법<a class=\"heading-anchor\" href=\"#how-to-use-django-with-daphne\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>:pypi:<a href=\"#id1\"><span class=\"problematic\" id=\"id2\">`</span></a>Daphne &lt;daphne&gt;`는 UNIX용 순수 Python ASGI 서버로, Django 프로젝트의 멤버들이 유지 관리합니다. ASGI의 참조 서버 역할을 합니다.</p>\n<section id=\"installing-daphne\">\n<h2>다프네 설치<a class=\"heading-anchor\" href=\"#installing-daphne\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p><a href=\"#id1\"><span class=\"problematic\" id=\"id2\">``</span></a>pip``로 Daphne를 설치할 수 있습니다.</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>python<span class=\"w\"> </span>-m<span class=\"w\"> </span>pip<span class=\"w\"> </span>install<span class=\"w\"> </span>daphne\n</code></pre></div>\n</section>\n<section id=\"running-django-in-daphne\">\n<h2>다프네에서 djagno 작동<a class=\"heading-anchor\" href=\"#running-django-in-daphne\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>다프네가 설치되면 다프네 서버 프로세스를 시작하는 <a href=\"#id1\"><span class=\"problematic\" id=\"id2\">``</span></a>다프네” 명령이 나온다. 간단히 말해, 다프네는 ASGI 애플리케이션 개체를 포함하는 모듈의 위치로 호출되어야 하며, 그 다음에 애플리케이션 이름이 콜론으로 구분됩니다.</p>\n<p>일반적인 Django 프로젝트의 경우 Daphne를 호출하는 방법은 다음과 같습니다.</p>\n<div class=\"code-block\" data-language=\"shell\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code>daphne<span class=\"w\"> </span>myproject.asgi:application\n</code></pre></div>\n<p>이로써 “127.0.0.1:8000”에 대한 청취가 시작된다. 프로젝트가 Python 경로에 있어야 합니다. <a href=\"#id1\"><span class=\"problematic\" id=\"id2\">``</span></a>관리”와 동일한 디렉토리에서 이 명령을 실행해야 합니다.</p>\n</section>\n<section id=\"integration-with-runserver\">\n<span id=\"daphne-runserver\"></span><h2><a href=\"#id1\"><span class=\"problematic\" id=\"id2\">``</span></a>runserver``와 통합하기<a class=\"heading-anchor\" href=\"#integration-with-runserver\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Daphne는 개발 중에 ASGI로 사이트를 제공할 수 있도록 <a class=\"reference internal\" href=\"/ko/6.1/ref/django-admin/#django-admin-runserver\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">runserver</span></code></a> 명령을 제공합니다.</p>\n<p>이는 <code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">INSTALLED_APPS`의</span> <span class=\"pre\">시작</span> <span class=\"pre\">부분에</span> <span class=\"pre\">``daphne``를</span> <span class=\"pre\">추가하고,</span> <span class=\"pre\">ASGI</span> <span class=\"pre\">애플리케이션</span> <span class=\"pre\">객체를</span> <span class=\"pre\">가리키는</span> <span class=\"pre\">``ASGI_APPLICATION`</span></code> 설정을 추가하면 활성화할 수 있습니다:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">INSTALLED_APPS</span> <span class=\"o\">=</span> <span class=\"p\">[</span>\n    <span class=\"s2\">&quot;daphne&quot;</span><span class=\"p\">,</span>\n    <span class=\"o\">...</span><span class=\"p\">,</span>\n<span class=\"p\">]</span>\n\n<span class=\"n\">ASGI_APPLICATION</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;myproject.asgi.application&quot;</span>\n</code></pre></div>\n</section>","rootId":"how-to-use-django-with-daphne","toc":[{"title":"다프네 설치","anchor":"installing-daphne","children":[]},{"title":"다프네에서 djagno 작동","anchor":"running-django-in-daphne","children":[]},{"title":"``runserver``와 통합하기","anchor":"integration-with-runserver","children":[]}],"breadcrumbs":[{"docname":"howto/index","title":"How-to 가이드","url":"/ko/6.1/howto/"},{"docname":"howto/deployment/index","title":"장고를 배포하는 방법","url":"/ko/6.1/howto/deployment/"},{"docname":"howto/deployment/asgi/index","title":"ASGI를 사용하여 배포하는 방법","url":"/ko/6.1/howto/deployment/asgi/"}],"prev":{"docname":"howto/deployment/asgi/index","title":"ASGI를 사용하여 배포하는 방법","url":"/ko/6.1/howto/deployment/asgi/"},"next":{"docname":"howto/deployment/asgi/granian","title":"How to use Django with Granian","url":"/ko/6.1/howto/deployment/asgi/granian/"},"formats":{"html":"/ko/6.1/howto/deployment/asgi/daphne/","markdown":"/ko/6.1/howto/deployment/asgi/daphne.md","json":"/ko/6.1/howto/deployment/asgi/daphne.json"},"source":"https://github.com/django/django/blob/stable/6.1.x/docs/howto/deployment/asgi/daphne.txt","official":"https://docs.djangoproject.com/ko/6.1/howto/deployment/asgi/daphne/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0"],"inLocales":["en","sv","zh-hans","ga","fr","ja","id","it","pt-br","ko","es","el","pl"]}