我试图安装自定义包。
这是为具有原型的 Plone4 制作的。
访问http://0.0.0.0:8086/Plone/@@site-controlpanel出现这个错误。
这是什么意思?
2017-10-31 11:50:06 ERROR Zope.SiteErrorLog 1509450606.040.577270977101 http://0.0.0.0:8086/Plone/@@site-controlpanel
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module plone.z3cform.layout, line 67, in __call__
Module plone.z3cform.layout, line 84, in render
Module Products.Five.browser.pagetemplatefile, line 125, in __call__
Module Products.Five.browser.pagetemplatefile, line 59, in __call__
Module zope.pagetemplate.pagetemplate, line 132, in pt_render
Module five.pt.engine, line 98, in __call__
Module z3c.pt.pagetemplate, line 163, in render
Module chameleon.zpt.template, line 261, in render
Module chameleon.template, line 191, in render
Module chameleon.template, line 171, in render
Module e50eb39ab1e3e2ab91a240ce2e2f728e.py, line 233, in render
Module five.pt.expressions, line 154, in __call__
Module five.pt.expressions, line 123, in traverse
Module OFS.Traversable, line 313, in unrestrictedTraverse
- __traceback_info__: ([], 'prefs_main_template')
KeyError: 'prefs_main_template'
- Expression: "here/prefs_main_template/macros/master"
- Filename: ... .7.egg/plone/app/registry/browser/controlpanel_layout.pt
- Location: (line 6: col 23)
- Source: ... al:use-macro="here/prefs_main_template/macros/master"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Arguments: repeat: {...} (0)
template: <ViewPageTemplateFile - at 0xb3b0e9ecL>
views: <ViewMapper - at 0xb0e1a30cL>
modules: <instance - at 0xb6393b8cL>
args: <tuple - at 0xb74cd02cL>
here: <ImplicitAcquisitionWrapper Plone at 0xb11b76e4L>
user: <ImplicitAcquisitionWrapper - at 0xb114b52cL>
nothing: <NoneType - at 0x83132e4>
container: <ImplicitAcquisitionWrapper Plone at 0xb11b76e4L>
request: <instance - at 0xb150ab0cL>
wrapped_repeat: <SafeMapping - at 0xb1707fa4L>
traverse_subpath: <list - at 0xb1ad51ccL>
default: <object - at 0xb74f3a18L>
loop: {...} (0)
context: <ImplicitAcquisitionWrapper Plone at 0xb11b76e4L>
view: <SiteControlPanel site-controlpanel at 0xb1576becL>
translate: <function translate at 0xb30eea04L>
root: <ImplicitAcquisitionWrapper Zope at 0xb36ca9b4L>
options: {...} (0)
target_language: <NoneType - at 0x83132e4>
然后我在 Zope2-2.13.26-py2.7.egg/OFS/Traversable.py 添加断点
if getattr(aq_base(obj), name, _marker) is not _marker:
if restricted:
next = guarded_getattr(obj, name)
else:
import pdb; pdb.set_trace()
print obj, name, getattr(aq_base(obj), name, _marker)
next = getattr(obj, name)
- 名称是 prefs_main_template。
- obj 是 PloneSite。
- getattr 返回无。