Search code examples
djangodjango-urlsdjango-haystack

Django-haystack undefined function


on this line of code in views.py for my app i get this error

url(r'^search/', include('haystack.urls'))

NameError: name 'include' is not defined

I think 'haystack.urls' is somehow not being included in my database but am not sure how to figure out if my hunch is correct. Thanks in advance!


Solution

  • Python can't find the include function (thus the message that include is not defined. You must import it like this:

    from django.conf.urls import url, include