gpt4 book ai didi

Django 错误 - 导入错误 : cannot import name get_cache

转载 作者:行者123 更新时间:2023-12-01 04:55:02 28 4
gpt4 key购买 nike

我正在使用 Django 1.8 运行我的项目,它运行正常。但是现在我不得不将 Django 升级到 1.9,当我再次运行我的项目时,它给出了一个错误 - ImportError: cannot import name 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

关于Django 错误 - 导入错误 : cannot import name get_cache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38025850/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com