"TypeError: make_staticdir() got an unexpected keyword argument 'document_root'" running Diazo through Proxy

"TypeError: make_staticdir() got an unexpected keyword argument 'document_root'" running Diazo through Proxy

我完全遵循了 docs.plone.org 上的 Diazo 快速入门指南中的步骤(docs.diazo.org 已过时,因为我在 2015 年 4 月写了这篇文章)并且在我尝试执行时收到了一个奇怪的错误最后的命令 bin/gearbox serve --reload -c proxy.ini。此错误使我无法继续,也没有指出它来自哪里。

我收到的确切错误是:

File "eggs/PasteDeploy-1.5.2-py2.7.egg/paste/deploy/util.py", line 55, in fix_call
val = callable(*args, **kw)
TypeError: make_staticdir() got an unexpected keyword argument 'document_root'

有谁知道如何解决这个问题以便继续开发我的 Plone 主题?

原来这个错误是由proxy.ini文件中的一个错误引起的,由于这个错误在webobentrypoints库中抛出了一个被抑制的错误。要更正此问题,请将标题为 "app:static" 的 proxy.ini 的第三部分更改为使用 "path" 而不是不正确的 "document_root",这样它现在包含以下内容:

[app:static]
use = egg:webobentrypoints#staticdir
path = %(here)s/theme

但是,一旦您解决了这个问题,您仍然需要解决另一个问题:快速入门指南尝试代理的页面已更改,因此它将重定向您的浏览器并且不显示您的主题。我很幸运将 proxy.ini 的最后一节切换到现在托管在 plone.org:

的同一文档的最新版本
[app:content]
use = egg:webobentrypoints#proxy
address = http://docs.plone.org/external/diazo/docs/index.html
suppress_http_headers = accept-encoding connection

要正确设置该站点的主题,您现在必须进一步修改 rules.xml 文件以呈现 class“.content-column”而不是“.content”。它应该看起来像:

<rules
    xmlns="http://namespaces.plone.org/diazo"
    xmlns:css="http://namespaces.plone.org/diazo/css"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <theme href="theme/theme.html" />

    <drop css:content="#indices-and-tables" />
    <replace css:theme-children="#content" css:content-children=".content-column" />
</rules>

希望这能解决您的问题。

注意:我已经提交了这些更改以包含在 Diazo 文档中,但是,特别是考虑到在四处寻找帮助时可以轻松找到该文档的多个版本,在中央文档中记录这个可能的错误似乎是明智的位置。