我使用django-haystack django-haystack==2.0.0
和xapian xapian-haystack==1.1.5b0
将Django从1.5升级到1.7。
[Mon Nov 16 13:32:48.685396 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] File "/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/dispatch/dispatcher.py", line 198, in send
[Mon Nov 16 13:32:48.685469 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] response = receiver(signal=self, sender=sender, **named)
[Mon Nov 16 13:32:48.685481 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] File "/home/kbuzz/lib/python2.7/haystack/__init__.py", line 59, in reset_search_queries
[Mon Nov 16 13:32:48.685520 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] for conn in connections.all():
[Mon Nov 16 13:32:48.685530 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 112, in all
[Mon Nov 16 13:32:48.685597 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] return [self[alias] for alias in self.connections_info]
[Mon Nov 16 13:32:48.685608 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 100, in __getitem__
[Mon Nov 16 13:32:48.685634 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] self._connections[key] = load_backend(self.connections_info[key]['ENGINE'])(using=key)
[Mon Nov 16 13:32:48.685644 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 53, in load_backend
[Mon Nov 16 13:32:48.685657 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] return import_class(full_backend_path)
[Mon Nov 16 13:32:48.685666 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 23, in import_class
[Mon Nov 16 13:32:48.685679 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] raise ImportError("The Python module '%s' has no '%s' class." % (module_path, class_name))
[Mon Nov 16 13:32:48.685695 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] ImportError: The Python module 'xapian_backend' has no 'XapianEngine' class.
更新
我尝试切换到whoosh
而不是xapian,但错误仍然存在。
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'xapian_backend.XapianEngine',
'PATH': '/home/kbuzz/whoosh_index',
},
}