gpt4 book ai didi

python - django-cms 导入错误

转载 作者:行者123 更新时间:2023-11-28 19:25:24 25 4
gpt4 key购买 nike

我是 django 的新手,在学习了一些 django 教程后,我开始使用 django-cms(我需要用 django 开发一个 cms 站点-厘米)。

我已经编辑了设置文件并添加了 cms 所需的所有中间件和应用程序,所以一切正常并开始开发 html 模板,但有时在我重新启动服务器并获取以下是奇怪的错误

Error_1

Django Version: 1.4.3
Exception Type: ImportError
Exception Value:
cannot import name plugin_pool
Exception Location: /usr/lib/python2.7/site-packages/cms/admin/__init__.py in <module>, line 7
Python Executable: /usr/bin/python

Error_2

Django Version: 1.4.3
Exception Value: Reverse for 'pages-root' with arguments '()' and keyword arguments '{}' not found
Exception Location: /usr/lib/python2.7/site-packages/cms/models/__init__.py in new_reverse, line 67
Python Executable: /usr/bin/python
................

这是我有时遇到的两个错误,不知道为什么会遇到,因为它们突然出现,我能知道如何避免这些错误吗

部分设置如下

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'cms.middleware.multilingual.MultilingualURLMiddleware', #CMS
'cms.middleware.page.CurrentPageMiddleware', #CMS
'cms.middleware.user.CurrentUserMiddleware', #CMS
'cms.middleware.toolbar.ToolbarMiddleware', #CMS
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'cms',
'mptt',
'menus',
'south',
'sekizai',
'reversion',
'cms.plugins.text',
'filer',
'easy_thumbnails',
'cmsplugin_filer_file',
'cmsplugin_filer_image',
'cmsplugin_filer_teaser',
'cms.plugins.link',
'cms_themes',

)

最佳答案

使用 Django 1.4.3 我遇到了同样的问题:

ImportError at / - cannot import name plugin_pool

经过研究我发现只需将我的 django 更新到版本 1.4.5我的 plugin_pool 导入错误消失了。

关于python - django-cms 导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14435926/

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