AttributeError:'应用'对象没有属性'缓存'

时间:2017-07-30 12:39:05

标签: python django elasticsearch django-haystack

我安装了Django 1.10。我需要导入loafing但不能导入它。我正在尝试使用Haystack将我的django应用程序与elasticsearch连接,并希望构建索引。我想要运行的代码是

  

python manage.py rebuild_index

我得到的错误是:

    base ---dir
/Manish/Projects/Spark/ad-tracking-django-env/ad-tracking-django
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/django/core/management/__init__.py", line 341, in execute
    django.setup()
  File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/django/apps/config.py", line 199, in import_models
    self.models_module = import_module(models_module_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/catalog/models.py", line 79, in <module>
    for model_cls in connected_models():
  File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/catalog/utils.py", line 19, in connected_models
    yield apps.cache.get_model(*model_str.split('.'))
AttributeError: 'Apps' object has no attribute 'cache'

根据我的研究,错误背后的原因是因为目录&#39;库。在Django 1.10中有没有替代方案?即使我改变了一堆代码,我也有100多个错误

我得到的错误如下:

  

ImportError:没有名为util

的模块      

ImportError:没有名为loading

的模块      

ImportError:没有名为generic

的模块

0 个答案:

没有答案