2010-02-04 40 views
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')) 

和明年是我的代碼:Django的錯誤:連接到本地主機; 3312失敗,我用Django的獅身人面像

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


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

回答

1

不要使用分號來分隔主機和端口,您可以使用冒號:即localhost:3312而不是localhost;3312

1

什麼版本的獅身人面像? Django的獅身人面像?在sphinx.conf中設置的獅身人面像使用的port發生了變化。

searchd現在運行在127.0.0.1:9312。您當然可以在sphinx.con更改此端口。這樣做後重新啓動您的searchd

0

我認爲值得注意的是,如果你忘記轉身獅身人面像,你會得到這個錯誤信息。

相關問題