django错误:连接到本地主机;3312失败,我使用了django-sphinx

发布于 2024-08-19 21:47:30 字数 1266 浏览 5 评论 0原文

Traceback (most recent call last):

  File "D:\Python25\Lib\site-packages\django\core\servers\basehttp.py", line 280, in run
    self.finish_response()

  File "D:\Python25\Lib\site-packages\django\core\servers\basehttp.py", line 319, in finish_response
    for data in self.result:

  File "D:\Python25\Lib\site-packages\django\http\__init__.py", line 374, in __iter__
    self._iterator = iter(self._container)

  File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 240, in __iter__
    return iter(self._get_data())

  File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 404, in _get_data
    self._result_cache = list(self._get_results())

  File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 530, in _get_results
    results = self._get_sphinx_results()

  File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 517, in _get_sphinx_results
    raise SearchError, client.GetLastError()

SearchError: connection to localhost;3312 failed ((10061, 'Connection refused'))

接下来是我的代码:

from sphinx_test.models import File
from djangosphinx.models import SphinxSearch
def xx(request):
    return HttpResponse(File.search.query('test'))


urlpatterns = patterns('',
    (r'^$',xx),
)
Traceback (most recent call last):

  File "D:\Python25\Lib\site-packages\django\core\servers\basehttp.py", line 280, in run
    self.finish_response()

  File "D:\Python25\Lib\site-packages\django\core\servers\basehttp.py", line 319, in finish_response
    for data in self.result:

  File "D:\Python25\Lib\site-packages\django\http\__init__.py", line 374, in __iter__
    self._iterator = iter(self._container)

  File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 240, in __iter__
    return iter(self._get_data())

  File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 404, in _get_data
    self._result_cache = list(self._get_results())

  File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 530, in _get_results
    results = self._get_sphinx_results()

  File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 517, in _get_sphinx_results
    raise SearchError, client.GetLastError()

SearchError: connection to localhost;3312 failed ((10061, 'Connection refused'))

and next is my code:

from sphinx_test.models import File
from djangosphinx.models import SphinxSearch
def xx(request):
    return HttpResponse(File.search.query('test'))


urlpatterns = patterns('',
    (r'^
,xx),
)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

爱*していゐ 2024-08-26 21:47:30

您不使用分号来分隔主机和端口,而是使用冒号:即 localhost:3312 而不是 localhost;3312

You don't use a semicolon to separate host and port, you use a colon: i.e. localhost:3312 instead of localhost;3312.

你的呼吸 2024-08-26 21:47:30

狮身人面像什么版本? Django 狮身人面像? sphinx 在 sphinx.conf 中设置时使用的端口发生了变化。

searchd 现在在 127.0.0.1:9312 上运行。您当然可以在sphinx.con中更改此端口。执行此操作后重新启动 searchd

What version of sphinx? django-sphinx? There has been a change in the port that is used by sphinx as setup in sphinx.conf.

The searchd now runs on 127.0.0.1:9312. You can of course change this port in sphinx.con. Restart your searchd after you do so.

醉生梦死 2024-08-26 21:47:30

我认为值得注意的是,如果您忘记打开 sphinx,您将收到此错误消息。

I think it's worth noting that if you have forgotten to turn sphinx on you will get this error message.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文