初めて uwsgi を実行すると、次のエラーが表示されます: ImportError: 名前インデックスをインポートできません
uwsgi をキャンセルして再度実行すると動作しますが、サイトの速度が低下し、ランダムに 502 エラーが表示されます。django dev サーバーまたは HAYSTACK_ENABLE_REGISTRATIONS = False を使用すると、正常に動作します。
何が問題なのですか?
完全なトレースバック:
File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/__init__.py", line 36, in delayed_loader
return getattr(trans, real_name)(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/trans_real.py", line 193, in activate
_active[currentThread()] = translation(language)
File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/trans_real.py", line 176, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "/usr/local/lib/python2.6/dist-packages/django/utils/translation/trans_real.py", line 159, in _fetch
app = import_module(appname)
File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py", line 43, in import_module
__import__(name)
File "/home/user/prject/apps/external/haystack/__init__.py", line 6, in <module>
from haystack.sites import site
File "/usr/local/lib/python2.6/dist-packages/django_haystack-1.1.0-py2.6.egg/haystack/__init__.py", line 154, in <module>
handle_registrations()
File "/usr/local/lib/python2.6/dist-packages/django_haystack-1.1.0-py2.6.egg/haystack/__init__.py", line 151, in handle_registrations
search_sites_conf = importlib.import_module(settings.HAYSTACK_SITECONF)
File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py", line 43, in import_module
__import__(name)
File "/home/user/project/search_sites.py", line 4, in <module>
haystack.autodiscover()
File "/usr/local/lib/python2.6/dist-packages/django_haystack-1.1.0-py2.6.egg/haystack/__init__.py", line 121, in autodiscover
importlib.import_module("%s.search_indexes" % app)
File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py", line 43, in import_module
__import__(name)
File "/home/user/project/apps/activity/search_indexes.py", line 1, in <module>
from haystack import indexes
ImportError: cannot import name indexes