Setting up django-haystack for the first time - No module named 'haystack.backends.solr_backends'

Skip to first unread message

David Jones

Jun 17, 2016, 4:50:57 PM6/17/16
to django-haystack

I have been following a tutorial from 'Django by example' that introduces Solr and Haystack and run into a problem. I have made the necessary changes to INSTALLED_APPS in and also added the following:

    'default': {
        'ENGINE': 'haystack.backends.solr_backends.SolrEngine',
        'URL': ''
then I run

python build_solr_schema
and I get this error

ImportError: No module named 'haystack.backends.solr_backends'
this is my file

   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()
when I run django shell Im able to import haystack just fine but when I run the following:

from haystack.query import SearchQuerySet
sqs = SearchQuerySet().all()
I get the exact same error right after entering the 2nd line.

I have tried restarting Solr, still doesn't work.

I have Solr working fine locally and have created a new core within the admin and have all the files setup here and have all the required files copied over from the example folder that comes with the install:


what am I missing here? thanks

EDIT: Id like to add that I have installed django-haystack and pysolr with a venv but both show up if I do pip freeze. Solr was installed via Homebrew.


Mar 16, 2017, 1:45:04 PM3/16/17
to django-haystack
the port should be 8983. have you checked that?
and is solr running? can you see the solr page in

Reply all
Reply to author
0 new messages