我在我的生产cms中有一个小问题。其中一页(大约有50页)拒绝发布。我的意思是:如果我点击管理界面中的“发布”或者使用publish_page方法,我不会得到任何错误。在页面列表视图中,此页面旁边有一个绿色的复选标记。但是当我在那里浏览时,我得到了一个很好的404错误。如果我刷新页面列表视图,绿色的复选标记会变成红色标记(未发布)。
我不知道我应该从哪里开始调试这个问题。
>>> from cms.api import publish_page
>>> p = Page.objects.get(pk__exact=66)
>>> r = User.objects.get(pk=2)
>>> p2 = publish_page(p, r)
>>> p2
<cms.models.pagemodel.Page object at 0x3561910>
>>> p2.is_public_published()
True我的/var/log/httpd/access_log或/var/log/httpd/ error _log中没有错误跟踪(除了404警告之外)。以下是我的日志记录设置:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose'
},
},
'loggers': {
'django': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': True,
},
'django.request': {
'handlers': ['mail_admins'],
'level': 'DEBUG',
'propagate': True,
},
'department.models': {
'handlers': ['console'],
'level': 'DEBUG'
},
}
}你能建议我从哪里开始调试吗?谢谢!
罗伯托
更新:
我的虚拟环境安装了以下软件:
Django - 1.5.4 - active
PIL - 1.1.7 - active
Pillow - 2.2.1 - active
Pygments - 1.6 - active
Python - 2.7.3 - active development (/usr/lib/python2.7/lib-dynload)
South - 0.8.2 - active
argparse - 1.2.1 - active development (/usr/lib/python2.7)
bpython - 0.12 - active
cmsplugin-news - 0.4.2 - active
django-autoslug - 1.7.1 - active
django-ckeditor - 4.0.2 - active
django-classy-tags - 0.4 - active
django-cms - 2.4.2 - active
django-country-dialcode - 0.4.8 - active
django-extensions - 1.2.2 - active
django-guardian - 1.1.1 - active
django-hvad - 0.3 - active
django-modeltranslation - 0.6.1 - active
django-mptt - 0.5.2 - active
django-reusableapps - 0.1.1 - active
django-reversion - 1.7.1 - active
django-sekizai - 0.7 - active
djangocms-text-ckeditor - 1.0.10 - active
html5lib - 1.0b3 - active
pip - 1.2.1 - active
psycopg2 - 2.5.1 - active
python-ldap - 2.4.13 - active
python-magic - 0.4.6 - active
pytz - 2013.7 - active
setuptools - 1.1.6 - active
six - 1.4.1 - active
switch2bill-common - 2.8.1 - active
wsgiref - 0.1.2 - active development (/usr/lib/python2.7)发布于 2013-10-21 20:02:55
页面的列表视图是Django-CMS很大程度上是由ajax请求提供支持的。
我将使用Firebug查看该视图,看看是否有任何发布函数从ajax请求中返回500个错误,而不会导致视图本身抛出500个错误。
我遇到过插件被破坏的情况,这反过来导致发布失败。在页面的列表视图中,页面显示为正确发布,复选框被选中等,但在Firebug中,这些ajax POST请求返回500个错误。
https://stackoverflow.com/questions/19361070
复制相似问题