Django-haystack 未定义函数

Django-haystack undefined function

在我的应用 views.py 中的这一行代码中出现此错误

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

NameError: name 'include' is not defined

我认为 'haystack.urls' 不知何故未包含在我的数据库中,但我不确定如何确定我的直觉是否正确。提前致谢!

Python 找不到 include 函数(因此消息 include 未定义。您必须像这样导入它:

from django.conf.urls import url, include