"NodeAlreadySaved "使用djangocms发布页面修改时出错
"NodeAlreadySaved " error when using djangocms publishing page changes
使用djangocms发布页面变化时遇到错误
当我运行tail -f /var/log/apache2/error.log
时,它返回:
treebeard.exceptions.NodeAlreadySaved: Attempted to add a tree node that is already in the database, referer: http://47.95.254.172/?edit
当我允许 settings.py DEBUG= True 并单击 'Publish page changes' 按钮时:
NodeAlreadySaved at /admin/cms/page/1/en/publish/
Attempted to add a tree node that is already in the database
Request Method: POST
Request URL: http://47.95.254.172/admin/cms/page/1/en/publish/
Django Version: 3.1.7
Exception Type: NodeAlreadySaved
Exception Value: Attempted to add a tree node that is already in the database
Exception Location: /root/env1/lib/python3.8/site-packages/treebeard/mp_tree.py, line 326, in process
Python Executable: /root/env1//bin/python
Python Version: 3.8.5
我有 运行 python manage.py cms fix-tree
但是没用。 python manage.py cms check
返回 10 次检查成功!.
我部署了 djangocms 项目:
apache2.4.41
mod-wsgi 4.8.0
django 3.1.7
django-cms 3.8.0
venv中的python版本是3.8.5,mod-wsgi是由venv中的python3.8.5编译的
感谢您的帮助!
降级到 4.5.1 以下的 django-treebeard 版本,例如4.4. 4.5.1版本似乎不兼容。
pip install django-treebeard==4.4
您还可以修改 requirements.txt
文件以反映不是 4.5.1
的不同 django-treebeard
版本:
django-treebeard>=4.0,!=4.5.1
那么你可以运行:
pip install -r requirements.txt
使用djangocms发布页面变化时遇到错误
当我运行tail -f /var/log/apache2/error.log
时,它返回:
treebeard.exceptions.NodeAlreadySaved: Attempted to add a tree node that is already in the database, referer: http://47.95.254.172/?edit
当我允许 settings.py DEBUG= True 并单击 'Publish page changes' 按钮时:
NodeAlreadySaved at /admin/cms/page/1/en/publish/
Attempted to add a tree node that is already in the database
Request Method: POST
Request URL: http://47.95.254.172/admin/cms/page/1/en/publish/
Django Version: 3.1.7
Exception Type: NodeAlreadySaved
Exception Value: Attempted to add a tree node that is already in the database
Exception Location: /root/env1/lib/python3.8/site-packages/treebeard/mp_tree.py, line 326, in process
Python Executable: /root/env1//bin/python
Python Version: 3.8.5
我有 运行 python manage.py cms fix-tree
但是没用。 python manage.py cms check
返回 10 次检查成功!.
我部署了 djangocms 项目:
apache2.4.41
mod-wsgi 4.8.0
django 3.1.7
django-cms 3.8.0
venv中的python版本是3.8.5,mod-wsgi是由venv中的python3.8.5编译的
感谢您的帮助!
降级到 4.5.1 以下的 django-treebeard 版本,例如4.4. 4.5.1版本似乎不兼容。
pip install django-treebeard==4.4
您还可以修改 requirements.txt
文件以反映不是 4.5.1
的不同 django-treebeard
版本:
django-treebeard>=4.0,!=4.5.1
那么你可以运行:
pip install -r requirements.txt