Google App Engine 到 Twisted

发布于 2024-09-19 07:52:52 字数 276 浏览 5 评论 0原文

我正打算将 GAE-OpenSocial 项目迁移到 Twisted Matrix 和 Nevow。我对 Nevow 模板非常陌生,除了 Divmod 的 Nevow 项目页面中给出的以外找不到好的文档。有没有关于Newow的书?我在 Nevow 中提供静态文件时遇到问题。对于应用程序引擎,可以轻松地在 app.yaml 中定义静态文件。但在这里我找不到合适的方法。请帮忙。

I was about to migrate the GAE-OpenSocial project to Twisted Matrix and Nevow. I am very new to Nevow templating and couldn't find good documentation other than given in Divmod's Nevow Project page. Is there any books relating to Nevow? I am having trouble serving static files in Nevow. For app engine its easy to define static files in app.yaml. But here I can't find a suitable way. Please help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

把时间冻结 2024-09-26 07:52:52

Nevow 的源目录 Nevow/examples/ 中有大量示例。这些都是可以运行的例子。您可以启动一个服务器,为它们提供索引页面,如下所示:

exarkun@boson:~/Projects/Divmod/trunk/Nevow/examples$ twistd -ny examples.tac
... [-] Log opened.
... [-] twistd 10.1.0+r30002 (/usr/bin/python 2.6.4) starting up.
... [-] reactor class: twisted.internet.selectreactor.SelectReactor.
... [-] nevow.appserver.NevowSite starting on 8080
... [-] Starting factory <nevow.appserver.NevowSite instance at 0x94cc8ec>

访问 http://localhost:8080/您将看到示例列表和链接以查看其来源或实际访问它们并查看其输出。

对于静态文件的特殊情况,答案非常简单,只需在某处提供 nevow.static.Filetwisted.web.static.File 即可。

There is a large collection of examples in Nevow's source directory, Nevow/examples/. These are all runnable examples. You can start a server which will serve an index page for them like so:

exarkun@boson:~/Projects/Divmod/trunk/Nevow/examples$ twistd -ny examples.tac
... [-] Log opened.
... [-] twistd 10.1.0+r30002 (/usr/bin/python 2.6.4) starting up.
... [-] reactor class: twisted.internet.selectreactor.SelectReactor.
... [-] nevow.appserver.NevowSite starting on 8080
... [-] Starting factory <nevow.appserver.NevowSite instance at 0x94cc8ec>

Visit http://localhost:8080/ and you'll see a list of the examples and links to see their source or actually visit them and see their output.

For the particular case of static files, the answer is pretty simple, simply serve up a nevow.static.File or a twisted.web.static.File somewhere.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文