Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7406637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:35:18+00:00 2026-05-29T05:35:18+00:00

Iam new to django-haystack, and I am trying to follow the getting started guide.

  • 0

Iam new to django-haystack, and I am trying to follow the getting started guide. However, I encounter an AttributeError: object has no attribute ‘Indexable’.

In my settins.py, I have:

HAYSTACK_SITECONF = 'mysite.search_sites'
HAYSTACK_SEARCH_ENGINE = 'solr'
HAYSTACK_SOLR_URL = 'http://127.0.0.1:8983/solr'

In my models.py (which resides in my app called “searchapp”), I have:

from django.db import models
from django.contrib.auth.models import User


class baymodel(models.Model):
    id = models.IntegerField(primary_key=True)
    domain = models.CharField(max_length=765, db_column='Domain', blank=True)
    category = models.CharField(max_length=765, db_column='Category', blank=True) 
    link = models.CharField(max_length=765, db_column='Link') 
    name = models.CharField(max_length=765, db_column='Name', blank=True) 
    cur_timestamp = models.DateTimeField()

    def __unicode__(self):
      return self.name

    def index_queryset(self):
    """Used when the entire index for model is updated."""
       return self.objects.all()

In my search_indexes.py (residing in my searchapp directory), I then have:

import datetime
from haystack import indexes
from searchapp.models import baymodel


class baymodelIndex(indexes.SearchIndex, indexes.Indexable):
    text = indexes.CharField(document=True, use_template=True)
    name = indexes.CharField(model_attr='user')
    link = indexes.CharField(model_attr='link')
    domain = indexes.CharField(model_attr='domain')
    pub_date = indexes.DateTimeField(model_attr='cur_timestamp')

def get_model(self):
    return baymodel

site.register(baymodel, baymodelIndex)

In search_sites.py, I have:

import haystack
haystack.autodiscover()

I have installed solr according to their instructions, and I can see the pretty solr admin page.

Now, when I do:

sudo python manage.py build_solr_schema

I get thrown an AttributeError:

AttributeError: 'module' object has no attribute 'Indexable'

I have tried to do:

python ./manage.py shell

and I again get:

AttributeError: 'module' object has no attribute 'Indexable'

If I simply go into python and try and import haystack, I get:

Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import haystack
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/haystack/__init__.py", line 26, in <module>
raise ImproperlyConfigured("You must define the HAYSTACK_SITECONF setting before using the search framework.")
django.core.exceptions.ImproperlyConfigured: You must define the HAYSTACK_SITECONF  setting before using the search framework.

which is strange because my settings.py does specify HAYSTACK_CONF and python ./manage.py shell throws an AttributeError.

Has anyone encountered a similar error? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:35:19+00:00Added an answer on May 29, 2026 at 5:35 am

    Code is based on haystack 2 which is in development, v2 changes the way indexes are defined. Installed version is 1.2 so the correct documents are available here, e.g.

    class BayModelIndex(indexes.SearchIndex, indexes.Indexable):
    

    should be (with correct import of SearchIndex):

    class BayModelIndex(SearchIndex):
    

    also instead of get_model, the index class needs index_queryset defined, which should return a QuerySet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Django and was trying this code in a tutorial. But
Hi iam new to c++ and iam trying out this vector program and i
I am new to Django, and I am trying to use django-friends in my
I am pretty new to Django and trying to use django-social-auth in my Django
Iam quite new to Google chart API's and I am trying to integrate it
Python 2.7.1 / Django 1.3 I am new to Django Templates and trying to
I am new to Django and have started working on a mature Django project.
I am new to Django and I am trying to build a data hierarchy
I am new to django and trying to learn how to create a django
However, I am very new to django and lighttpd and have very rough idea

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.