在我的项目中安装 Django Oscar 模块时出现错误,它给了我这个错误
from oscar import get_core_apps
ImportError: cannot import name 'get_core_apps'
这是我的 settings.py 文件...
from oscar import get_core_apps
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.flatpages',
'compressor',
'widget_tweaks',
'south',
] + get_core_apps()
这是我在终端上得到的错误代码...
self._databases = settings.DATABASES
File "/home/amit/.local/lib/python3.6/site-packages/django/conf/__init__.py", line 79, in __getattr__
self._setup(name)
File "/home/amit/.local/lib/python3.6/site-packages/django/conf/__init__.py", line 66, in _setup
self._wrapped = Settings(settings_module)
File "/home/amit/.local/lib/python3.6/site-packages/django/conf/__init__.py", line 157, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/amit/Desktop/Django/frobshop/frobshop/settings.py", line 32, in <module>
from oscar import get_core_apps
ImportError: cannot import name 'get_core_apps'