... プします。必要に応じて、あなたのプロジェクトと ASGI 準拠の Web サーバに合わせて微調整することができます。 Django には以下の ASGI サーバのために、手引きとなるドキュメントが用意 ... jango with Granian Django を Hypercorn とともに使う Django を Uvicorn とともに使う application オブジェクト WSGI と同様に、ASGI は application という呼び出し可能オブジェクトを提供しており、アプリケーション サーバはこれを使用してあなたのコードと通信し ... オブジェクトとして提供されています。 startproject コマンドは、この application 呼び出し可能オブジェクトを含む <project_name>/asgi.py ファイルを生成します。 開発サーバー ( runserver ) では使用されませんが、開発環境と本番環境のどちらでも、任意の ASGI サー ... ... がインストールされると、Daphne サーバプロセスを起動する daphne コマンドが利用できるようになります。Daphne を呼び出すには、ASGI アプリケーションオブジェクトを含むモジュールの場所と、それに続いてアプリケーションの名前を(コロンで区切って)指定する必要 ... があります。 典型的な Django プロジェクトでは、Daphne の起動は次のようになります: daphne myproject.asgi:application このコマンドは 127.0.0.1:8000 を待ち受けるプロセスを1つ起動します。プロジェクトは Python のパス上にある必要があ ... 実にするために、 manage.py ファイルと同じディレクトリからこのコマンドを実行してください。 runserver との統合 Daphneは開発中にASGIでサイトを動かすための runserver コマンドを提供しています。 これは INSTALLED_APPS の先頭に daphne を追加し、ASGI アプリケーシ ... ... ango in Granian When Granian is installed, a granian command is available which runs ASGI applications. Granian needs to be called with the location of a module containing an ASGI application object, followed by ... what the application is called (separated by a colon), using the --interface asgi option. For a typical Django project, invoking Granian would look like: granian myproject.asgi:application --interface asg ... ... sibility of the server or proxy to avoid ambiguous mappings. (Django's runserver was patched in CVE 2015-0219 .) But under ASGI, there is not the same uniform expectation, even if many proxies protect against this under default configuration (includi ... ng nginx via underscores_in_headers off; ). Headers containing underscores are now ignored by ASGIRequest , matching the behavior of Daphne , the reference server for ASGI. This issue has severity "low" according to the D ... severity "moderate" according to the Django security policy . CVE-2026-33034: Potential denial-of-service vulnerability in ASGI requests via memory upload limit bypass ASGI requests with a missing or understated Content-Length header could bypass the ... ... sibility of the server or proxy to avoid ambiguous mappings. (Django's runserver was patched in CVE 2015-0219 .) But under ASGI, there is not the same uniform expectation, even if many proxies protect against this under default configuration (includi ... ng nginx via underscores_in_headers off; ). Headers containing underscores are now ignored by ASGIRequest , matching the behavior of Daphne , the reference server for ASGI. This issue has severity "low" according to the D ... severity "moderate" according to the Django security policy . CVE-2026-33034: Potential denial-of-service vulnerability in ASGI requests via memory upload limit bypass ASGI requests with a missing or understated Content-Length header could bypass the ... ... されると、ASGIアプリケーションを実行する uvicorn コマンドが利用できるようになります。Uvicornを呼び出すには、ASGIアプリケーションオブジェク ... を指定する必要があります。 典型的な Django プロジェクトでは、Uvicorn の起動は次のようになります: python -m uvicorn myproject.asgi:application このコマンドは 127.0.0.1:8000 を待ち受けるプロセスを1つ起動します。プロジェクトは Python のパス上にある必要があ ... ip install uvicorn uvicorn-worker gunicorn Uvicornのworkerクラスを使ってGunicornを起動します: python -m gunicorn myproject.asgi:application -k uvicorn_worker.UvicornWorker ... ... ed. CVE-2026-3902: ASGI header spoofing via underscore/hyphen conflation ASGIRequest normalizes header names following WSGI conventions, mapping h ... sibility of the server or proxy to avoid ambiguous mappings. (Django's runserver was patched in CVE 2015-0219 .) But under ASGI, there is not the same uniform expectation, even if many proxies protect against this under default configuration (includi ... ng nginx via underscores_in_headers off; ). Headers containing underscores are now ignored by ASGIRequest , matching the behavior of Daphne , the reference server for ASGI. This issue has severity "low" according to the D ... ... orn で Django を実行 Hypercorn をインストールすると、ASGIアプリケーションを実行するための hypercorn コマンドが利用可能になります。Hypercornを使用するには、ASGIアプリケーションオブジ ... を指定する必要があります。 典型的な Django プロジェクトでは、Hypercorn の呼び出しは次のようになります。 hypercorn myproject.asgi:application このコマンドは 127.0.0.1:8000 を待ち受けるプロセスを1つ起動します。プロジェクトは Python のパス上にある必要があ ... ... り、低速ストリーミング、ロングポーリング、その他の便利なレスポンスタイプが使えます。 もしこれらを利用したい場合は、代わりに ASGI を使って Django をデプロイする必要があります。 注釈 A fully asynchronous request stack requires async middleware end-to-en ... d. Where a piece of synchronous middleware sits between an ASGI server and an async view, Django adapts it by running it in its own thread; see パフォーマンス for the cost trade-off. Dja ... logging for the django.request logger and look for log messages about "Asynchronous handler adapted for middleware ..." . ASGI モードと WSGI モードの両方で、コードを逐次的ではなく並行して実行するために、非同期サポートを安全に使用できます。これは、外 ... ... スが必要です。 runserver コマンドは軽量な開発サーバーを起動しますが、これは本番環境には適していません。 Djangoは現在、WSGIとASGIの2つのインターフェースをサポートしています。 WSGI はウェブサーバーとアプリケーション間で通信するためのPythonの主要な規格です ... 。ただし、同期的なコードしかサポートしていません。 ASGI は、Django サイトで非同期の Python 機能と非同期の Django 機能を使えるようにするための、新しい非同期フレンドリーな標準です。 ... ザーデータベースに対する Apache からの認証 application オブジェクト Settings モジュールを設定する WSGIミドルウェアを適用する ASGI とともにデプロイするには Django を Daphne とともに使う How to use Django with Granian Django を Hypercorn とともに使う Dja ... 2026年10月08日