Django Haystack 重建索引
我正在阅读 Haystack 的“入门”指南,并尝试使用 Haystack 为我的网站实现 Whoosh 后端。我成功地设置了整个项目,我还可以在我的 search.html 模板上看到搜索框。但我无法建立索引。
当我输入 ./manage.pyrebuild_index 时,出现错误:
未知命令:rebuild_index
我知道这是一个微不足道的问题。我无法理解manage.py 文件如何理解最初不属于它的命令。
I was reading the 'Getting Started' guide of Haystack and tried to implement Whoosh backend for my website with Haystack. I was successful in setting up the whole project and I can also see the search box on my search.html template. I am unable to build the index though.
When I type ./manage.py rebuild_index, I get the error:
Unknown command: rebuild_index
I know this is a trivial issue. I am unable to understand how the manage.py file can ever understand commands that were not originally a part of it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的
INSTALLED_APPS
中有haystack
吗?manage.py
通过导入settings.py
文件并从INSTALLED_APPS
变量加载模块来学习新命令。Do you have
haystack
in yourINSTALLED_APPS
?manage.py
learns new commands by importing thesettings.py
file and loading modules from yourINSTALLED_APPS
variable.