... す 。このデフォルト WSGI 設定は、あなたのプロジェクトに合わせて調整でき、WSGI に準拠したアプリケーションサーバにその設定を使用させることができます。 ... Django には以下の WSGI サーバのために、手引きとなるドキュメントが用意されています: How to use Django with Granian Django を Gunicorn とともに使う ... Django を uWSGI とともに使うには? Django を Apache と mod_wsgi とともに使うには? Django のユーザーデータベースに対する Apache からの認証 a ... ... rectly. This requires Apache version >= 2.2 and mod_wsgi >= 2.0. For example, you could: 認証されたユーザにのみ、静的/メディアファイルを Apache から直接提供する。 特定のパーミッシ ... という名前のリレーションを持ち、'name' フィールドを持つリレーション先のオブジェクトを参照する必要があります。カスタムの mod_wsgi 認証ハンドラがこれらの要件に適合しない場合は、 独自のカスタムの mod_wsgi 認証ハンドラを指定することもできます。 mod_wsgi に ... よる認証 注釈 以下の設定における WSGIApplicationGroup %{GLOBAL} の使用は、 Apache インスタンスが 1 つの Django アプリケーションだけを実行していることを想定してい ... ... ュールです。 Djangoはmod_wsgiをサポートしているApacheのすべてのバージョンで動作します。 mod_wsgi の使い方の詳細については、 the official mod_wsgi documen ... tation を参照してください。 installation and configuration documentation から始めるとよいでしょう。 基本設定 mod_wsgiをインストールして有効にしたら、Apacheサーバーの httpd.conf ファイルを編集して、以下を追加します。 WSGIScriptAlias / /path/t ... o/mysite.com/mysite/wsgi.py WSGIPythonHome /path/to/venv WSGIPythonPath /path/to/mysite.com <Directory /path/to/mysite.com/mysite > <Files wsgi.py ... ... ango in Granian When Granian is installed, a granian command is available which runs WSGI applications. Granian needs to be called with the location of a module containing a WSGI application object named applicat ... ion , using the --interface wsgi option. For a typical Django project, invoking Granian would look like: granian myproject.wsgi:application --interface wsg ... ... ows を使っていてこれから Django を始めるなら、 Windows での Django のインストール方法 を読むとよいでしょう。 Apache と mod_wsgi のインストール もし単に Django を使って実験したいだけなら、このセクションは飛ばしてください。 Django には軽量 web サーバー ... 境にデプロイするときまで、 Apache をセットアップする必要はありません。 本番サイトで Django を使用する場合は、 Apache と mod_wsgi を使用します。mod_wsgi は、埋め込みモードまたはデーモンモードの2つのモードのいずれかで動作します。埋め込みモードでは、mod_ ... の存続期間中、メモリに残ります。これにより、他のサーバー配置よりも大幅にパフォーマンスが向上します。デーモンモードでは、mod_wsgi はリクエストを処理する独立したデーモンプロセスを生成します。デーモンプロセスはウェブサーバーとは異なるユーザーとして実行で ... ... tutorial を提供しています (たくさんあるセットアップ方法の一例です)。以下のドキュメントは、Django を uWSGI と統合する方法に焦点を当てています。 前提条件: uWSGI uWSGI の wiki には、いくつかの installation procedures が記載されてい ... ます。Python のパッケージマネージャーであるpipを使って、あらゆるバージョンの uWSGI を一つのコマンドでインストールすることができます。たとえば: # Install current stable version. $ python -m pip install uwsg ... i uWSGI モデル uWSGI はクライアントサーバモデルで動作します。Web サーバー (nginx や Apache など) は django-uwsgi "worker" プロセス ... ... インストールします。詳細は gunicorn documentation を参照してください。 GunicornでDjangoを一般的なWSGIアプリケーションとして動作させる Gunicorn がインストールされると、Gunicorn サーバプロセスを起動する gunicorn コマンドが利用で ... きるようになります。gunicorn の最も単純な起動方法は、 application という WSGI アプリケーションオブジェクトを含むモジュールの場所を渡すことです 。典型的な Django プロジェクトでは次のようになります: gun ... icorn myproject.wsgi このコマンドは 127.0.0.1:8000 を待ち受ける1つのスレッドを実行する1つのプロセスを開始します。プロジェクトは Python のパス上 ... ... フェースが必要です。 runserver コマンドは軽量な開発サーバーを起動しますが、これは本番環境には適していません。 Djangoは現在、WSGIとASGIの2つのインターフェースをサポートしています。 WSGI はウェブサーバーとアプリケーション間で通信するためのPythonの主要な規 ... pplication to production, you should run through our deployment checklist to ensure that your configurations are suitable. WSGI とともにデプロイするには How to use Django with Granian Django を Gunicorn とともに使う Django を uWSGI とともに使うには? ... Django を Apache と mod_wsgi とともに使うには? Django のユーザーデータベースに対する Apache からの認証 application オブジェクト Settings モジュールを設 ... ... d into the WSGI environ, they are normalized by converting to uppercase, converting all dashes to underscores, and prepending HTTP_ . For ... instance, a header X-Auth-User would become HTTP_X_AUTH_USER in the WSGI environ (and thus also in Django's request.META dictionary). Unfortunately, this means that the WSGI environ cannot distin ... ... all dashes to underscores, and prepending HTTP_ . For instance, a header X-Auth-User would become HTTP_X_AUTH_USER in the WSGI environ (and thus also in Django's request.META dictionary). Unfortunately, this means that the WSGI environ cannot distin ... 2026年10月08日