4

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.

Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
Vikesh
  • 2,018
  • 6
  • 23
  • 33

1 Answers1

9

Do you have haystack in your INSTALLED_APPS?

manage.py learns new commands by importing the settings.py file and loading modules from your INSTALLED_APPS variable.

intgr
  • 19,834
  • 5
  • 59
  • 69
  • Thank you sir, that was the problem. I did not have haystack in INSTALLED_APPS. I did not know that manage.py loads modules from installed apps.Thanks a lot. – Vikesh Apr 03 '11 at 06:14
  • I guess that's how manage.py also loads modules - views, urls, admin, models etc. when we run the development server (./manage.py runserver) for all the usual apps of the website. – Vikesh Apr 03 '11 at 06:47
  • 1
    That's how it does it for the real server, too. – Mike DeSimone Apr 16 '11 at 04:33
  • simple solutions to simple problems. +1 – Brian D Aug 28 '11 at 17:01