---
title: "Come usare Django con Daphne"
version: 4.2
locale: it
source: https://docs.djangoproject.com/it/4.2/howto/deployment/asgi/daphne/
canonical: https://djangodocs.dev/it/4.2/howto/deployment/asgi/daphne/
---
# Come usare Django con Daphne

[Daphne](https://pypi.org/project/daphne/) is a pure-Python ASGI server for UNIX, maintained by
members of the Django project. It acts as the reference server for ASGI.

## Installare Daphne

You can install Daphne with `pip`:

```shell
python -m pip install daphne
```

## Eseguire Django con Daphne

Quando Daphne è installato, è disponibile un comando `daphne` 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).

For a typical Django project, invoking Daphne would look like:

```shell
daphne myproject.asgi:application
```

Questo avvierà il processo che ascolta su `127.0.0.1:8000`. Richiede che il tuo progetto sia sul percorso di Python; per assicurartene, lancia questo comando dalla stessa directory del tuo file `manage.py`.

## Integration with `runserver`

Daphne provides a [`runserver`](/it/4.2/ref/django-admin/#django-admin-runserver) command to serve your site under ASGI
during development.

This can be enabled by adding `daphne` to the start of your
[`INSTALLED_APPS`](/it/4.2/ref/settings/#std-setting-INSTALLED_APPS) and adding an `ASGI_APPLICATION` setting pointing
to your ASGI application object:

```
INSTALLED_APPS = [
    "daphne",
    ...,
]

ASGI_APPLICATION = "myproject.asgi.application"
```
