<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jkx@home &#187; twisted</title>
	<atom:link href="http://www.larsen-b.com/tags/twisted/feed" rel="self" type="application/rss+xml" />
	<link>http://www.larsen-b.com</link>
	<description>Titanium Exposé</description>
	<lastBuildDate>Wed, 20 May 2026 16:33:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Python web developpement: the dilemma  / Act 2</title>
		<link>http://www.larsen-b.com/Article/160.html</link>
		<comments>http://www.larsen-b.com/Article/160.html#comments</comments>
		<pubDate>Tue, 14 Sep 2004 22:23:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[twisted]]></category>
		<category><![CDATA[Webware]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[After a long trip around the Python web developpement tools, it&#8217;s time to fix. In a previous post (please read all comments before ..) we have talk for a long time about various web frameworks. Here is my personnal conclusion: &#8230; <a href="http://www.larsen-b.com/Article/160.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>After a long trip around the Python web developpement tools, it&#8217;s time to fix. In a <a class="reference" href="http://www.larsen-b.com/Article/130.html">previous post</a> (please read all comments before ..) we have talk for a long time about various web frameworks. Here is my personnal conclusion:</p>
<ul class="simple">
<li>A web framework has nothing to do with templates. It need to allow to wrap templates easily, but it should&#8217;nt deal with them directly. (I have done DTML in a past life.. no thanks:)</li>
<li>A web framework has nothing to deal w/ the object-store. It should let me store objects as i want (without too much pain)</li>
</ul>
<p>In the <a class="reference" href="http://www.larsen-b.com/Article/130.html">previous post</a> we talk about the different approach: <strong>Threads</strong>, <strong>Mod_Python</strong>, <strong>Twisted</strong>, and <strong>Fork</strong> (in comments)</p>
<p>I have tested quite a bunch of framework right now, all have some nice feature, and drawback. To conclude my <em>tour</em> and explain my choice, some little points:</p>
<div id="webware" class="section">
<h1><a name="webware">Webware</a></h1>
<p>I really enjoy Webware, because the API is really easy learn, and work like a charm. But as explain before, I have too much trouble w/ the threads in.. I hope cheetah will <a class="reference" href="http://www.larsen-b.com/Article/108.html">cleanup</a> the way it includes Kits.. a long thread on the mailing list.</p>
</div>
<div id="mod-python" class="section">
<h1><a name="mod-python">Mod_Python</a></h1>
<p>I don&#8217;t like the mod_python Publisher etc etc, I feal too close-to-apache. So i guess the I will choose MP Servlets. Performance are really good, and doesn&#8217;t need to maintain a server process on the host. This is good news because i want to host a couple of little websites. The major drawback is that there is no way to maintain (or even limit) a pool of objects between request. (without apache tweak) Another bad point is that debugging is <em>awfull</em>, need to restart all the time ..<br />
But mod_python offer a lot for deployement..</p>
</div>
<div id="twisted" class="section">
<h1><a name="twisted">Twisted</a></h1>
<p>This is the most flamewar subject, I ever seen on the Python community. I used twisted, and yes it&#8217;s really fun and powerfull. But I don&#8217;t want to mix deferred and threads (for DB .. and others stuffs). If I want to mix differents networks stuffs, twisted is my tool. but as previouly said (comments) I &#8216;m not really fuent with twisted.web</p>
</div>
<div id="skunk-web" class="section">
<h1><a name="skunk-web">Skunk-Web</a></h1>
<p>Hum, this is a fork based server.. I haven&#8217;t tested it a lot because it&#8217;s really template base, and I want to use Cheetah or ZPT not another-templating-o-matic. And fork, may cause issue if you have some hits (but skunk really seems to work well under heavy load so.. )</p>
</div>
<div id="and-now" class="section">
<h1><a name="and-now">And now..</a></h1>
<p>So, yes, i haven&#8217;t choose one of this. In fact, in the <a class="reference" href="http://www.larsen-b.com/Article/130.html">previous post</a> somebody ask me about <a class="reference" href="http://www.mems-exchange.org/software/quixote/">Quixote</a>, so i decided to test it. And I found an interesting stuff,<br />
<a class="reference" href="http://www.mems-exchange.org/software/quixote/">Quixote</a> use: scgi (mod_scgi + daemon), old-fashion-cgi or mod_python, medusa or twisted.</p>
<p><strong>So I can:</strong></p>
<ul class="simple">
<li>use mod_python in production area. (nothing more than apache :)</li>
<li>use mod_scgi if i want to run the server as a different user. No need to use su-exec or fight w/ ownerships&#8230;</li>
<li>use medusa to develop. And that&#8217;s a really good point because i can use pdb to debug,and avoid to restart mod_python again and again.</li>
<li>use old-fashion-cgi on system that only provides this..</li>
<li>test Durus + Dulcinea for the fun.</li>
</ul>
<p><strong>There is some drawbacks of course:</strong></p>
<ul class="simple">
<li>really small documentation right now (check the <a class="reference" href="http://quixote.ca/qx/">Quixote Wiki</a>)</li>
<li>I don&#8217;t really like the way it map the URL namespace to the modules</li>
<li>come w/ custom templating system, but cheetah has a handler (infos in the wiki)</li>
</ul>
<p>As <a class="reference" href="http://www.base-art.net">Phil</a> said: <em>This is your new toy, until the next</em>.</p>
<p>He&#8217;s right. I dream one day, Python web&#8217;s framework will be more unified. Quixote is a good example of what power we can achieve if the framework cover a large amount of different approach in a unified way.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/160.html/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Twisted in EndUserLand</title>
		<link>http://www.larsen-b.com/Article/134.html</link>
		<comments>http://www.larsen-b.com/Article/134.html#comments</comments>
		<pubDate>Wed, 14 Jul 2004 12:20:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[twisted]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[As nobody notice that, the new apt-proxy use python (not perl as the old one). This is really a good news because i love Python and the new apt-proxy has some better performance than the oldest perlish one. The key &#8230; <a href="http://www.larsen-b.com/Article/134.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>As nobody notice that, the new apt-proxy use python (not perl as the old one). This is really a good news because i love Python and the new apt-proxy has some better performance than the oldest perlish one. The key value here is the Twisted Matrix framework, now apt-proxy can download multiple .deb at the time without a bunch of process or other weakness. This is a great new for debian users but specially for twisted developper because i think it&#8217;s the first end-user app that use twisted (not speaking about webserver of other developpers geeky stuffs).</p>
<p>&#8211; Nobody for a twisted bittorrent server ? This would save a bunch of CPU cycles too !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/134.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Python web developpement: the dilemma</title>
		<link>http://www.larsen-b.com/Article/130.html</link>
		<comments>http://www.larsen-b.com/Article/130.html#comments</comments>
		<pubDate>Sun, 20 Jun 2004 12:16:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[twisted]]></category>
		<category><![CDATA[Webware]]></category>
		<category><![CDATA[Zope]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[There is a bunch of Python based web framework. So much that it&#8217;s a really hard choice to do. Most of them came w/ a special templating language, and a different approach. Dilemma 1 I really think most of the &#8230; <a href="http://www.larsen-b.com/Article/130.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>There is a <a class="reference" href="http://www.python.org/cgi-bin/moinmoin/WebProgramming">bunch</a> of Python based web framework. So much that it&#8217;s a really hard choice to do. Most of them came w/ a special templating language, and a different approach.</p>
<div id="dilemma-1" class="section">
<h1><a name="dilemma-1">Dilemma 1</a></h1>
<p>I really think most of the frameworks, have nothing to do with templating. We should give up with that mixOmatic. A framework is a framework not a templating language. So while looking for a good framework, never looks at its templating system, since you should use the one you want. (not the one that come with the framework).</p>
</div>
<div id="dilemma-2" class="section">
<h1><a name="dilemma-2">Dilemma 2</a></h1>
<p>The second thing that run me in trouble is the approach. I find about 3 different way to handle requests, and still wondering what is the best choice</p>
<div id="thread-approach" class="section">
<h2><a name="thread-approach">Thread approach</a></h2>
<p><a class="reference" href="http://www.w4py.org">Webware</a> has this kind of approach. It maintain a pool of servlets, and use apache as front-end to dispatch to webware server. This approach is really interesting since you can really tweak performance by maintaining the some cached stuff .. By the other side, you have all the drawbacks of this way to using:</p>
<ul class="simple">
<li>A lot of python module aren&#8217;t thread safe. Even the <a class="reference" href="http://www.sqlobject.org">SQLObject</a> which is normally written in this way have trouble with thread. <a class="reference" href="http://www.base-art.net">Phil</a> lost part of the night to discover that SQLO + SQLite run give him a bunch of errors..</li>
<li>Really hard to deploy: Since the servlet pool doesn&#8217;t support advanced caching, every single servlet load stay loaded all the time. (I want to deploy a bunch of website .. something like 20 .. with low traffic that isn&#8217;t the right way)</li>
</ul>
</div>
<div id="mod-python-approach" class="section">
<h2><a name="mod-python-approach">Mod_Python approach</a></h2>
<p>There is a lot of frameworks that use this way. The one i really enjoy is <a class="reference" href="http://home.comcast.net/~d.popowich/mpservlets/">MP Servlets</a>. The major feature is that it use Apache 2 thread behaviour, so you don&#8217;t have to use python threads. This sound really good, and you don&#8217;t have to launch a python server on the host. But the major drawback is that there is no way to maintain (or even limit) a pool of objects between request. (This is possible but you need to tweak the apache way to handle request to disable threading for a proceess&#8230; and this isn&#8217;t a good approach for virtual hosted website).</p>
</div>
<div id="twisted-approach" class="section">
<h2><a name="twisted-approach">Twisted approach</a></h2>
<p><a class="reference" href="http://twistedmatrix.com/">Twisted</a> try to fix the thread problem by using a single loop, and async request handling. With that you can:</p>
<ul class="simple">
<li>enjoy the python world without thread nightmare</li>
<li>desging small dedicated servers</li>
</ul>
<p>But once again this way have a major drawback has you will be unable to use stuff like SQLObject since Twisted require some specials database connection to avoid locking (remember single loop). And i don&#8217;t want to use the old fashiong sql way to build website. Another thing to remember about Twisted is that you need to use apache to proxy the request to the host, and i don&#8217;t really think that this way is really pretty for performance.</p>
</div>
</div>
<div id="conclusion" class="section">
<h1><a name="conclusion">Conclusion ?</a></h1>
<p>I don&#8217;t have a good conclusion. I know <a class="reference" href="http://www.zope.org">Zope</a> can fix some of this problem, but <a class="reference" href="http://www.zope.org">Zope</a> is a too hard to developp / maintain for me. Zope3 tend to be more simple for a lot of ways, but still under developpement, and need a lot of work to learn right now.</p>
<p><strong>Update</strong>: Nobody seems to have a decent solution :) Really strange no ?</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/130.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Twisted or not</title>
		<link>http://www.larsen-b.com/Article/46.html</link>
		<comments>http://www.larsen-b.com/Article/46.html#comments</comments>
		<pubDate>Tue, 11 Nov 2003 12:10:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[twisted]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I spent a couple of hours to look at http://www.twistedmatrix.com/ . After a little of hacking, i think i understand how it works, mainly static.File. But i still need to work on this since i want to use it to &#8230; <a href="http://www.larsen-b.com/Article/46.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I spent a couple of hours to look at <a class="reference" href="http://www.twistedmatrix.com/">http://www.twistedmatrix.com/</a> . After a little of hacking, i think i understand how it works, mainly static.File. But i still need to work on this since i want to use it to share some large files and this need a little work to avoid locking the whole system.</p>
<p>Perhaps using static.File as core of my system will do the trick but as i want to do some bandwith limitation i need to write some custom stuffs. ..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.larsen-b.com/Article/46.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
