[Twisted-Python] Page Templates (Zope) with twisted.web
![](https://secure.gravatar.com/avatar/ea23400810b1d09463141b976a337256.jpg?s=120&d=mm&r=g)
Twisted folks, I experimented briefly with twisted several months ago. After banging my head against the Zope wall for a while, I am back to twisted. One ray of hope in the Zope confusion was Zope Page Templates (ZPT). According to http://www.zopelabs.com/cookbook/998065931, ZPT can be used outside of Zope. I can kind of envision this, but I am not yet twisted enough. Is anyone already working on using Page Templates within a twisted web? I also saw some mention of using WebWare as a presentation layer. Are there any examples of using WebWare with twisted web. Thanks, Tim Chase chase@iac.net
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Mon, 2002-04-29 at 15:16, Tim Chase wrote:
Twisted folks,
Hi, Tim! [An eerie chorous of the Twisted minions' voices chants a beat later: "Hi, Tim!"]
That was originally the plan. However (*nudge to dp here...*) none of us have had a good experience with ZPT yet, and very few of us have had experience with ZPT at all. If I had any major web projects coming up in the future, I'd probably implement it myself just to give it a try, but my work seems to be taking me down a decidedly non-web path for the time being. (And those web things I do wouldn't be sufficiently aided by ZPT to justify the effort.)
I also saw some mention of using WebWare as a presentation layer. Are there any examples of using WebWare with twisted web.
No. I've mostly decided against webware, since it has a rather naive worldview and I've been unimpressed with the software technically. My impression of the webware _project_ is that it's very well run; their documentation and support by *far* put Twisted to shame. However, that project is producing an application server I'm not too interested in. Donovan Preston has recently become the de-facto web guru for Twisted, and his work so far (twisted.web.domtemplate) I find fascinating; it seems to have most of the advantages of ZPT, but it is a lot simpler. I have even somehow managed to coerce him into writing a little bit of documentation, currently in CVS... Check that out and let me know if it solves your templating issues. -- | <`'> | Glyph Lefkowitz: Travelling Sorcerer | | < _/ > | Lead Developer, the Twisted project | | < ___/ > | http://www.twistedmatrix.com |
![](https://secure.gravatar.com/avatar/433365de0f787faa3ed3e6dd1da5884f.jpg?s=120&d=mm&r=g)
Tim Chase wrote:
At some point I might try to do it. The main issue is how to deal with expressions that returns Deferreds. The options are: 1. Render page templates in threads 2. Use stackless 3. Hack the rendering loop so that it can deal with Deferreds correctly. (2) is coolest, but problematic due to stackless' cross-platform issues. (1) is probably slowest option, (3) may be difficult to do, depending on how the code is structured.
![](https://secure.gravatar.com/avatar/433365de0f787faa3ed3e6dd1da5884f.jpg?s=120&d=mm&r=g)
Itamar Shtull-Trauring wrote:
At some point I might try to do it. The main issue is how to deal with expressions that returns Deferreds. The options are:
And BTW, domtemplate's lack of Deferred support is also problematic. The Web As We Know It is a big database front end, mostly. And database calls block. I'm thinking we should have a threaded web server for cases where the backend is ZODB or RDBMS only, and just access the database directly, without using twisted.enterprises.
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Tue, 2002-04-30 at 04:47, Itamar Shtull-Trauring wrote:
Certainly. At this point it's still in development, but I think that DOMtemplate could be modified to support Deferreds pretty easily (after all, it's almost like WebWidgets, except instead of returning lists of Deferreds and strings, it returns lists of Deferreds and Nodes). I may even get around to doing this :-). As far as threading goes -- we need a threadsafe version of web.Request, and a way to dispatch requests in an MT way, yes, I agree. The fact that this is inefficient should be offset by the fact that every other web-app framework in the world is at least 3x less efficient than _that_ :) -- | <`'> | Glyph Lefkowitz: Travelling Sorcerer | | < _/ > | Lead Developer, the Twisted project | | < ___/ > | http://www.twistedmatrix.com |
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Mon, 2002-04-29 at 15:16, Tim Chase wrote:
Twisted folks,
Hi, Tim! [An eerie chorous of the Twisted minions' voices chants a beat later: "Hi, Tim!"]
That was originally the plan. However (*nudge to dp here...*) none of us have had a good experience with ZPT yet, and very few of us have had experience with ZPT at all. If I had any major web projects coming up in the future, I'd probably implement it myself just to give it a try, but my work seems to be taking me down a decidedly non-web path for the time being. (And those web things I do wouldn't be sufficiently aided by ZPT to justify the effort.)
I also saw some mention of using WebWare as a presentation layer. Are there any examples of using WebWare with twisted web.
No. I've mostly decided against webware, since it has a rather naive worldview and I've been unimpressed with the software technically. My impression of the webware _project_ is that it's very well run; their documentation and support by *far* put Twisted to shame. However, that project is producing an application server I'm not too interested in. Donovan Preston has recently become the de-facto web guru for Twisted, and his work so far (twisted.web.domtemplate) I find fascinating; it seems to have most of the advantages of ZPT, but it is a lot simpler. I have even somehow managed to coerce him into writing a little bit of documentation, currently in CVS... Check that out and let me know if it solves your templating issues. -- | <`'> | Glyph Lefkowitz: Travelling Sorcerer | | < _/ > | Lead Developer, the Twisted project | | < ___/ > | http://www.twistedmatrix.com |
![](https://secure.gravatar.com/avatar/433365de0f787faa3ed3e6dd1da5884f.jpg?s=120&d=mm&r=g)
Tim Chase wrote:
At some point I might try to do it. The main issue is how to deal with expressions that returns Deferreds. The options are: 1. Render page templates in threads 2. Use stackless 3. Hack the rendering loop so that it can deal with Deferreds correctly. (2) is coolest, but problematic due to stackless' cross-platform issues. (1) is probably slowest option, (3) may be difficult to do, depending on how the code is structured.
![](https://secure.gravatar.com/avatar/433365de0f787faa3ed3e6dd1da5884f.jpg?s=120&d=mm&r=g)
Itamar Shtull-Trauring wrote:
At some point I might try to do it. The main issue is how to deal with expressions that returns Deferreds. The options are:
And BTW, domtemplate's lack of Deferred support is also problematic. The Web As We Know It is a big database front end, mostly. And database calls block. I'm thinking we should have a threaded web server for cases where the backend is ZODB or RDBMS only, and just access the database directly, without using twisted.enterprises.
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Tue, 2002-04-30 at 04:47, Itamar Shtull-Trauring wrote:
Certainly. At this point it's still in development, but I think that DOMtemplate could be modified to support Deferreds pretty easily (after all, it's almost like WebWidgets, except instead of returning lists of Deferreds and strings, it returns lists of Deferreds and Nodes). I may even get around to doing this :-). As far as threading goes -- we need a threadsafe version of web.Request, and a way to dispatch requests in an MT way, yes, I agree. The fact that this is inefficient should be offset by the fact that every other web-app framework in the world is at least 3x less efficient than _that_ :) -- | <`'> | Glyph Lefkowitz: Travelling Sorcerer | | < _/ > | Lead Developer, the Twisted project | | < ___/ > | http://www.twistedmatrix.com |
participants (3)
-
Glyph Lefkowitz
-
Itamar Shtull-Trauring
-
Tim Chase