尝试在django-haystack文档之后安装Haystack安装和配置的基本教程,但由于我无法在Search-Indexes py文件中导入haystack,因此我遇到了一个问题 Haystack安装在env和根目录
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'haystack',
'products',
]
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
'URL': 'http://127.0.0.1:8983/solr'
},
}
import datetime
from haystack import indexes <<error can't find indexes
还在 - &gt;
(amirshop) amir@amir-In######:~/####/#####$ python manage.py shell
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from haystack import indexes
>>> indexes.
indexes.BasicSearchIndex( indexes.FacetDateField( indexes.NgramField( indexes.__package__ indexes.get_identifier(
indexes.BooleanField( indexes.FacetDateTimeField( indexes.SearchField( indexes.__reduce__( indexes.get_model_ct(
问题是什么或究竟在哪里?
答案 0 :(得分:1)
我再次将我的pycharm指向usr bin中的myenv 使用这个步骤:here谢谢@Sardorbek Imomaliev 1 -