2016-09-25 76 views
0

我正在學習Django。Djano:Solr rebuild_index錯誤403

我必須爲測試應用程序構建搜索引擎。

search_indexes.py

from haystack import indexes 
from .models import Post 

class PostIndex(indexes.SearchIndex, indexes.Indexable): 
    text = indexes.CharField(document=True, use_template=True) 
    publish = indexes.DateTimeField(model_attr='publish') 

    def get_model(self): 
     return Post 

    def index_queryset(self, using=None): 
     return self.get_model().published.all()` 

我創建和設置Solr的核心管理我的應用程序。

,當我嘗試執行python manage.py rebuild_index我得到這個錯誤:

raise SolrError(error_message % (resp.status_code, solr_message)) 
pysolr.SolrError: Solr responded with an error (HTTP 403): [Reason: None] 

而且也是繼HTML響應(這只是一個迴應的一部分):

<h1>This Page Cannot Be Displayed</h1> 
 
<p> 
 
Based on your organization's security policies, this web site( http://127.0.0.1/solr/blog/update/?commit=true )has been blocked because it has been determined to be a securitythreat to your computer or the organization's network.Access could also be blocked because this request came from anunrecognized or unauthorized machine. 
 
</p> 
 
<p> 
 
If you have questions, please contactyour organization's network administrator and provide the codes shown below.</p> 
 
</div>

我有「博客「申請。我有Post模型。我在博客應用程序目錄博客/搜索/索引/博客/ post_text.txt

image of blog core admin in solr

任何幫助創造出來的?

謝謝。

+0

夥計們,問題是我的代理設置。 – milutinke

回答