在Heroku上使用Django设置Websolr

时间:2012-04-04 19:47:16

标签: django heroku websolr

我正在尝试在Heroku上添加对我的django强大应用程序的WebSolr支持。他们有使用Ruby实现的详细说明:

https://devcenter.heroku.com/articles/websolr

但我无法弄清楚如何将它与Haystack联系起来。有没有人这样做过?

感谢。

编辑:

我能够通过将settings.py文件修改为:

来实现
HAYSTACK_URL      = os.environ.get('WEBSOLR_URL', '')
HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
        'URL': HAYSTACK_URL,

    },
}                                       

然后跑步:

heroku run myproject/manage.py build_solr_schema > schema.xml 

schema.xml的内容上传到websolr界面的高级选项卡。一旦我跑了

heroku run myproject/manage.py rebuild_index

建立了索引。

1 个答案:

答案 0 :(得分:1)

我已根据您的问题更新了Heroku Websolr Docs以包含有关Django的部分。感谢那。有关我们文档的建议,请对this gist发表评论。

相关问题