Django错误 – ImportError:无法导入名称get_cache

我正在使用Django 1.8运行我的项目,它运行正常.但是当我再次运行我的项目它给出了一个错误时,我不得不将Django升级到1.9 – ImportError:无法导入名称get_cache.

python manage.py syncdb

我得到以下:

Traceback (most recent call last):
File "manage.py", line 10, in <module> execute_from_command_line(sys.argv)
File "/home/vermahim17/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 350,
  in execute_from_command_line utility.execute()
File "/home/vermahim17/env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
  line 324, in execute django.setup()
File "/home/vermahim17/env/local/lib/python2.7/site-packages/django/__init__.py",
  line 18, in setup apps.populate(settings.INSTALLED_APPS)
File "/home/vermahim17/env/local/lib/python2.7/site-packages/django/apps/registry.py",
  line 85, in populate app_config = AppConfig.create(entry)
File "/home/vermahim17/env/local/lib/python2.7/site-packages/django/apps/config.py",
  line 90, in create module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py",
  line 37, in import_module __import__(name)
File "/home/vermahim17/env/local/lib/python2.7/site-packages/keyedcache/__init__.py",
  line 27, in <module>
from django.core.cache import get_cache, InvalidCacheBackendError, DEFAULT_CACHE_ALIAS ImportError: cannot import name get_cache

最佳答案 我认为,Django 1.9没有提供导入get_cache方法的规定.请仔细研究这个问题

https://github.com/vstoykov/django-imagekit/commit/c26f8a0

点赞