django 1.9.6
とmod_wsgi
を使用してアプリケーションを仮想マシンにインストールするためのスクリプトがあります。それは少なくとも1年間は正常に動作するために使用し、私はそれを使用していない数ヶ月後に - それは突然動作していない。私はいつもきれいなubuntuの信頼できるイメージにインストールしていますが、私は何も変更しませんでした。だから私の推測では、apt-get
は別のバージョンのlibapache2-mod-wsgi
をインストールしています。Djangoとmod_wsgiのインストールが突然停止しました
sudo apt-get update
sudo apt-get install -y python-pip
sudo pip install django=1.9.6
sudo pip install python-social-auth
sudo apt-get -y install apache2 libapache2-mod-wsgi
...
私はアプリケーションにApacheサーバを実行しようと、エラーを与える:
[Tue Oct 17 11:52:29.184072 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] mod_wsgi (pid=8178): Target WSGI script '/root/geosearch_app/geosearch_project/geosearch_project/wsgi.py' cannot be loaded as Python module.
[Tue Oct 17 11:52:29.184116 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] mod_wsgi (pid=8178): Exception occurred processing WSGI script '/root/geosearch_app/geosearch_project/geosearch_project/wsgi.py'.
[Tue Oct 17 11:52:29.184140 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] Traceback (most recent call last):
[Tue Oct 17 11:52:29.184159 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] File "/root/geosearch_app/geosearch_project/geosearch_project/wsgi.py", line 16, in <module>
[Tue Oct 17 11:52:29.184212 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] application = get_wsgi_application()
[Tue Oct 17 11:52:29.184225 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] File "/usr/local/lib/python2.7/dist-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Tue Oct 17 11:52:29.184266 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] django.setup()
[Tue Oct 17 11:52:29.184280 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 18, in setup
[Tue Oct 17 11:52:29.184327 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] apps.populate(settings.INSTALLED_APPS)
[Tue Oct 17 11:52:29.184339 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 108, in populate
[Tue Oct 17 11:52:29.184458 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] app_config.import_models(all_models)
[Tue Oct 17 11:52:29.184471 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 202, in import_models
[Tue Oct 17 11:52:29.184549 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] self.models_module = import_module(models_module_name)
[Tue Oct 17 11:52:29.184561 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
[Tue Oct 17 11:52:29.184738 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] __import__(name)
[Tue Oct 17 11:52:29.184751 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] File "/usr/local/lib/python2.7/dist-packages/social/apps/django_app/default/models.py", line 1, in <module>
[Tue Oct 17 11:52:29.184791 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] from social_django.models import AbstractUserSocialAuth, UserSocialAuth, Nonce, Association, Code, DjangoStorage
[Tue Oct 17 11:52:29.184819 2017] [:error] [pid 8178:tid 140000402241280] [remote 131.111.64.116:33385] ImportError: No module named social_django.models
[Tue Oct 17 11:52:29.289697 2017] [:error] [pid 8178:tid 140000419026688] [remote 131.111.64.116:24169] mod_wsgi (pid=8178): Target WSGI script '/root/geosearch_app/geosearch_project/geosearch_project/wsgi.py' cannot be loaded as Python module.
[Tue Oct 17 11:52:29.289725 2017] [:error] [pid 8178:tid 140000419026688] [remote 131.111.64.116:24169] mod_wsgi (pid=8178): Exception occurred processing WSGI script '/root/geosearch_app/geosearch_project/geosearch_project/wsgi.py'.
[Tue Oct 17 11:52:29.289745 2017] [:error] [pid 8178:tid 140000419026688] [remote 131.111.64.116:24169] Traceback (most recent call last):
[Tue Oct 17 11:52:29.289768 2017] [:error] [pid 8178:tid 140000419026688] [remote 131.111.64.116:24169] File "/root/geosearch_app/geosearch_project/geosearch_project/wsgi.py", line 16, in <module>
[Tue Oct 17 11:52:29.289799 2017] [:error] [pid 8178:tid 140000419026688] [remote 131.111.64.116:24169] application = get_wsgi_application()
[Tue Oct 17 11:52:29.289809 2017] [:error] [pid 8178:tid 140000419026688] [remote 131.111.64.116:24169] File "/usr/local/lib/python2.7/dist-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Tue Oct 17 11:52:29.289827 2017] [:error] [pid 8178:tid 140000419026688] [remote 131.111.64.116:24169] django.setup()
[Tue Oct 17 11:52:29.289836 2017] [:error] [pid 8178:tid 140000419026688] [remote 131.111.64.116:24169] File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 18, in setup
[Tue Oct 17 11:52:29.289850 2017] [:error] [pid 8178:tid 140000419026688] [remote 131.111.64.116:24169] apps.populate(settings.INSTALLED_APPS)
[Tue Oct 17 11:52:29.289859 2017] [:error] [pid 8178:tid 140000419026688] [remote 131.111.64.116:24169] File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 78, in populate
[Tue Oct 17 11:52:29.289873 2017] [:error] [pid 8178:tid 140000419026688] [remote 131.111.64.116:24169] raise RuntimeError("populate() isn't reentrant")
[Tue Oct 17 11:52:29.289891 2017] [:error] [pid 8178:tid 140000419026688] [remote 131.111.64.116:24169] RuntimeError: populate() isn't reentrant
それが前に働いていたので、私は実際にはインストールスクリプト以外は何も変更せずにこの問題を解決したいと考えて、それが動作するはずです。
アドバイスはありますか?
'wsgi.py'があるディレクトリに' __init __。py'ファイルがあることを確認してください。 'cd /path/to/wsgi.py && touch __init __。py' – raratiru
それがあります。私が言ったように、それはずっと前に働いたし、何も変わらなかった。 – user4421975
私はあなたが提供するエラーの3つの点を参照してください。何故ですか? 'ターゲットWSGIスクリプト '/.../ wsgi.py' '。これはまったく正常ではありません。 – raratiru