LoginSignup
1
1

More than 5 years have passed since last update.

Windows + Apache + mod_wsgi + サービスで djangoなアプリケーションを実行する。

Posted at

Windows(10 64bit) + Apache(2.4) + Python 3.5.2 + mod_wsgi(4.5.7) な環境でdjangoアプリケーションをサービスとして実行した際にうまくいかないことがあったのでメモ。

うまくいく場合

コンソールからhttpdを直接実行

うまくいかない場合

サービスとしてhttpdを実行

  • mod_wsgi読み込みエラーがでる。
  • apacheのエラーログを見ると
    Fatal Python error: Py_Initialize: unable to load the file system codec ImportError: No module named 'encodings'
    みたいなのが出ている

やったこと

環境変数 PYTHONPATH を(全ユーザに)設定する。
c:\python3\Lib
とかそういう感じ。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1