{"title":"Come usare Django con Daphne","version":"4.1","locale":"it","docname":"howto/deployment/asgi/daphne","url":"/it/4.1/howto/deployment/asgi/daphne/","canonical":"https://djangodocs.dev/it/4.1/howto/deployment/asgi/daphne/","summary":"Daphne è un server ASGI per UNIX scritto completamente in Python e mantenuto da membri del progetto Django. Funge da server di riferimento per ASGI.","html":"<h1>Come usare Django con Daphne<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><a class=\"reference external\" href=\"https://pypi.org/project/daphne/\">Daphne</a> è un server ASGI per UNIX scritto completamente in Python e mantenuto da membri del progetto Django. Funge da server di riferimento per ASGI.</p>\n<section id=\"installing-daphne\">\n<h2>Installare Daphne<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>Puoi installare Daphne con <code class=\"docutils literal notranslate\">pip</code>:</p>\n<div class=\"code-block\" data-language=\"bash\"><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 -m pip install daphne\n</code></pre></div>\n</section>\n<section id=\"running-django-in-daphne\">\n<h2>Eseguire Django con Daphne<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>Quando Daphne è installato, è disponibile un comando <code class=\"docutils literal notranslate\">daphne</code> che avvia il processo server. Nella sua forma più semplice, Daphne necessita di essere chiamato con la locazione di un modulo che contiene un oggetto di applicazione ASGI, seguito da come si chiama l’applicazione (separati dai due punti).</p>\n<p>Per un progetto Django «tipo», invocare Daphne sembrerà:</p>\n<div class=\"code-block\" data-language=\"bash\"><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 myproject.asgi:application\n</code></pre></div>\n<p>Questo avvierà il processo che ascolta su <code class=\"docutils literal notranslate\">127.0.0.1:8000</code>. Richiede che il tuo progetto sia sul percorso di Python; per assicurartene, lancia questo comando dalla stessa directory del tuo file <code class=\"docutils literal notranslate\">manage.py</code>.</p>\n</section>","rootId":"how-to-use-django-with-daphne","toc":[{"title":"Installare Daphne","anchor":"installing-daphne","children":[]},{"title":"Eseguire Django con Daphne","anchor":"running-django-in-daphne","children":[]}],"breadcrumbs":[{"docname":"howto/index","title":"guide «How-to»","url":"/it/4.1/howto/"},{"docname":"howto/deployment/index","title":"Come distribuire Django","url":"/it/4.1/howto/deployment/"},{"docname":"howto/deployment/asgi/index","title":"Come distribuire con ASGI.","url":"/it/4.1/howto/deployment/asgi/"}],"prev":{"docname":"howto/deployment/asgi/index","title":"Come distribuire con ASGI.","url":"/it/4.1/howto/deployment/asgi/"},"next":{"docname":"howto/deployment/asgi/hypercorn","title":"Come utilizzare Django con Hypercorn","url":"/it/4.1/howto/deployment/asgi/hypercorn/"},"formats":{"html":"/it/4.1/howto/deployment/asgi/daphne/","markdown":"/it/4.1/howto/deployment/asgi/daphne.md","json":"/it/4.1/howto/deployment/asgi/daphne.json"},"source":"https://github.com/django/django/blob/stable/4.1.x/docs/howto/deployment/asgi/daphne.txt","official":"https://docs.djangoproject.com/it/4.1/howto/deployment/asgi/daphne/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2"],"inLocales":["en","zh-hans","fr","ja","id","it","pt-br","ko","es","el","pl"]}